v5.pm for rakudo
Perl6 Perl
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
build
src
t
.gitignore
Build.pm
META.info
README.md
STATUS-m.md
STATUS-p6m.md
STATUS.md
TODO.md
TODO_compound_statements.md
TODO_core_modules.md
p5

README.md

v5 - Perl5 for rakudo

v5 will let you run Perl 5 code beside Perl 6 code, like:

use v6;
grammar Foo {
    method bar { ... }
}

{
    use v5;
    if( $^O eq 'MSWin32' ) {
        say $0 # Perl 5's special variable for program name
    }
    
    {
        use 6.0.0;
        multi sub foo(*@args) {
            ...
        }
    }
}

say "Back to Perl 6 on a $*DISTRO.name box." # $*DISTRO is a Perl 6's "special variable"

The goal is to be able to run all pure-Perl 5 code besides Perl 6. One benefit of this approach (reimplementing Perl 5 with Perl 6's object system) is to be able to pass data/objects easily between both languages. XS will not be supported, since it depends of Perl 5's internal structure.

INSTALLATION

panda install v5

USAGE

perl6 my_script.pl             # run a file that has a `use v5` at the top
perl6 -MPerl5 my_old_script.pl # run a file that hasn't