Do you know where your variables are? | |
PerlMonks |
Re: (tye)Re: Unusual Closure Behaviourby suaveant (Parson) |
on Jul 12, 2001 at 17:51 UTC ( [id://96028]=note: print w/replies, xml ) | Need Help?? |
his first example
is very much a closure, because $x is lexically scoped to that block, and sub foo is by definition global and survives the loop, $x goes away, except for the one reference in sub foo. his second one, however, would not be a closure. - Ant
In Section
Seekers of Perl Wisdom
|
|