foreach has to create a fresh variable every time. Otherwise, when you keep a reference to one (as with the anonymous subroutine), they would all hold the same value every time a new value was assigned in the loop.
(And thanks to Animator for clearing up my sloppy wording on this)
Cheers,
Ovid
New address of my CGI Course.
In reply to Re^2: Are we seeing syntax inconsistency?
by Ovid
in thread Are we seeing syntax inconsistency?
by TibetPerlMonk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |