Perl: the Markov chain saw | |
PerlMonks |
Re^3: why need my in a foreach loop?by ikegami (Patriarch) |
on Nov 28, 2010 at 23:23 UTC ( [id://874146]=note: print w/replies, xml ) | Need Help?? |
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 Section
Seekers of Perl Wisdom
|
|