On Thu, 8 Nov 2001, Brent Dax wrote:
> That doesn't support your argument. The point is that in the statement:
>
> foreach(@array) {
> ...
> }
>
> @array should only be evaluated once, at the beginning of the loop. In
> effect (using := here, but otherwise Perl 5 code):
Oops, you're right - I pulled the wrong section from perlsyn. I think
this is the correct paragraph:
If any part of LIST is an array, "foreach" will get very
confused if you add or remove elements within the loop
body, for example with "splice". So don't do that.
;)
-sam