the subroutine is a closure
Backwards. It works because the subroutine doesn't capture package variables. If you switched our for my in my snippet, you'd have a closure, and you'd get a different result.
In reply to Re^3: why need my in a foreach loop?
by ikegami
in thread why need my in a foreach loop?
by szabgab
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |