And everyone is going to have to learn the other way for perl 6 because lexicals spring into existence immediately upon being parsed (not the whole statement, just the variable). So, in this code:
Both $x refer to the same storage location (the same variable). To get the perl5 behavior you have to say something like:my $x = $x + 5;
my $x = $OUTER::x + 5;
In reply to Re^3: Iterative anonymous subroutines
by duff
in thread Iterative anonymous subroutines
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |