Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Did you know you can use your Perl 5 code in Perl 6 and vice-versa?

For example, if you've installed the Perl 5 DBI from CPAN then you can use that in Perl 6 code like this:

    use DBI:from<Perl5>;

    my $dbh = DBI.connect('dbi:Pg:database=test');
    my $products = $dbh.selectall_arrayref(
        'select * from products', {Slice => {}}
    );
I'm not saying Perl 6 is ready or right for you. But Perl 6 doesn't exactly have the Python 2 / Python 3 problem. CPAN authors don't have to port anything and you don't have to port anything to be able to use existing Perl 5 code in Perl 6 (and vice-versa).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: