Perl6::Contexts - array and hash variables turn into references to themselves when used in non-numeric scalar context or as function arguments.
SYNOPSIS
my @foo = ( 1 .. 20 );
my $foo = @foo; # same as: my $foo = @foo;
my $foo = 0 + @foo; # unchanged - length of @foo
$obj->some_method(10, 20, @foo); # same as: $obj->some_method(10, 20, @foo);
some_function(10, 20, @foo); # same as: some_function(10, 20, @foo);
Perl6::Contexts makes Perl 5 behave more like Perl 6 with regard to the array and hash variables as used as arguments to operators, method calls, and functions.
This module doesn't add new syntax -- it merely changes the meaning of existing syntax. Using this module to make Perl 5 more like Perl 6 won't go very far towards writing Perl 5 that will run under Perl 6 but it will help you get used to some of the changes.
To run legacy Perl 5 along side Perl 6, check out PONIE or Inline::Pugs.
Requirements:
· Perl
Product's homepage
Requirements:
· Perl