in reply to Re^2: Lexical closures
in thread Lexical closures
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Lexical closures
by JavaFan (Canon) on Oct 25, 2008 at 23:03 UTC |