Think about Loose Coupling | |
PerlMonks |
Re: Scalar Value Not Available To Subroutineby tobyink (Canon) |
on Dec 20, 2012 at 17:13 UTC ( [id://1009762]=note: print w/replies, xml ) | Need Help?? |
It seems that $uid should be visible and defined in the sub. The lexical scope of the $uid variable ought to cover the sub, and the dynamic scope of the loop should cover the calls to the sub. Odd; I can't say I exactly understand what's happening here. Works if you do our $uid though.
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
|
|