|
|
| The stupid question is the question not asked | |
| PerlMonks |
Re^3: What is the scope of $_?by tobyink (Prior) |
| on Nov 26, 2012 at 23:16 UTC ( #1005774=note: print w/ replies, xml ) | Need Help?? |
|
As I said, all the OP's examples use the global $_ but some Perl control structures localize that variable. The same effect is illustrated here using global $::x...
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||