http://qs1969.pair.com?node_id=265682


in reply to Re: Re: Inserting into an array while stepping through it
in thread Inserting into an array while stepping through it

I just wanted to point out that the index ($i) does not have to be global. You could write:

while (my $i < @a)

... and have $i scoped to the while loop. Check out Lexical scoping like a fox.