Nice catch.
If you switched our for my in my snippet, you'd have a closure, and you'd get a different result.
Is that correct? Because the my variable would still be in scope, would the subroutine qualify as a closure? It's my understanding that a subroutine is a closure when it preserves a variable that has gone out of scope.In reply to Re^4: why need my in a foreach loop?
by 7stud
in thread why need my in a foreach loop?
by szabgab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |