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.
|
---|
In Section
Seekers of Perl Wisdom