Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Re: Re: Inserting into an array while stepping through it

by zakb (Pilgrim)
on Jun 13, 2003 at 14:11 UTC ( #265682=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://265682]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2020-11-24 10:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?