"be consistent" | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I find calling something broken before you even know the reason to be.. daring to say the least. If it were "fixed", a number of things we're used to doing with the aliasing property of foreach such as s/foo/bar/ for @array; would cease to work. Frankly I wouldn't have it another way - more than a few times have I found the persisting iteration variable value behaviour of FOR loops in Pascal and C annoying, and more than a few times have I found the aliasing behaviour of Perl's foreach useful. If you need the value, then just do manually what Perl avoids to: copy it to a variable from the surrounding scope on each iteration. Makeshifts last the longest. In reply to Re^2: for loop localisation bug?
by Aristotle
|
|