in reply to Re: for loop localisation bug?
in thread for loop localisation bug?
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re^2: for loop localisation bug?
by BrowserUk (Patriarch) on Dec 29, 2003 at 18:35 UTC | |
by greenFox (Vicar) on Dec 30, 2003 at 11:27 UTC | |
by Aristotle (Chancellor) on Dec 30, 2003 at 13:27 UTC | |
by Roy Johnson (Monsignor) on Dec 30, 2003 at 16:30 UTC | |
|
Re^2: for loop localisation bug?
by SavannahLion (Pilgrim) on Dec 29, 2003 at 18:28 UTC |