If I wanted a localized variable I write the loop as "for my $j (...)".
If I explicitly use "for $i" I make clear my intention of using a previously introduced variable.
Why perl then insists on knowing better and localizing it is counter-intuitive to me and at the moment I don't see any reason why it should be implemented like that (but there probably is one)...
In reply to Re^2: loop surprise
by morgon
in thread loop surprise
by morgon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |