Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by zakb (Pilgrim)
on Jun 13, 2003 at 14:11 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://265682]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-25 10:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found