Keep It Simple, Stupid | |
PerlMonks |
Re: what is the scope of my $x=$xby duff (Parson) |
on Jun 05, 2006 at 14:47 UTC ( [id://553606]=note: print w/replies, xml ) | Need Help?? |
In perl5, you have two different $x. In perl6, both $x are the same $x. To get at a variable named $x in an outer scope you need to use the fully qualified name of the variable which would include information about whether it's a global variable (GLOBAL::<$x>, perl6 has true globals BTW), a variable in the symbol table of the current package (OUR::<$x>), or a lexical variable in the surrounding lexical scope (OUTER::<$x>).
In Section
Seekers of Perl Wisdom
|
|