laziness, impatience, and hubris | |
PerlMonks |
Re^3: Lexical closuresby GrandFather (Saint) |
on Oct 25, 2008 at 20:51 UTC ( [id://719554]=note: print w/replies, xml ) | Need Help?? |
No. The confusion is that Perl effectively closes over the value of the variable, not a reference to the variable. All languages that I know where you can declare a variable locally to the scope of a block (including a block for a loop) effectively set up a new stack frame on each entry to the block, but the loop variable is outside that block or it couldn't maintain its contents from one iteration to the next. Perl reduces RSI - it saves typing
In Section
Seekers of Perl Wisdom
|
|