I never realized that a simple loop like this ... actually allocated and destroyed a new array every time through the loop. Since you go around the loop twice, it seems like you don't "leave" the scope in which @a was delcared, so @a should still "be there" during the second iteration. I still don't get that.
In for(...) { ... } the curly braces define a block. Each time the loop iterates you re-enter that block. And every time you enter a block, you enter a new scope.
That is just the way it is, and the way it is meant to be.
In reply to Re^3: Scope and references
by BrowserUk
in thread Scope and references
by {}think
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |