pugs - Pragma for using Perl 6 inside Perl 5
#!/usr/bin/perl use pugs; # Here is some Perl 6 code... sub postfix:<!> { [*] 1..$_ } sub sum_factorial { [+] 0..$_! } no pugs; # Here is some Perl 5 code... print sum_factorial(3); # 21
The pugs module lets you put Perl 6 code in Perl 5 source code after a line of:
use pugs;
To switch back to Perl 5:
no pugs;
Perl6::Pugs
Brian Ingerson <INGY@cpan.org>
<INGY@cpan.org>
Copyright (c) 2005. Brian Ingerson. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html.
To install Perl6::Pugs, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Perl6::Pugs
CPAN shell
perl -MCPAN -e shell install Perl6::Pugs
For more information on module installation, please visit the detailed CPAN module installation guide.