Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^4: process array with while loop

by ikegami (Patriarch)
on Nov 09, 2006 at 18:46 UTC ( [id://583188]=note: print w/replies, xml ) Need Help??


in reply to Re^3: process array with while loop
in thread process array with while loop

In order to to allow "", 0, undef, etc in the array, the general form would be

while (@array) { my $item = shift @array; # or pop ... push(@array, ...); # or unshift ... }

(It's not a problem in your case since every item in @dirs starts with ..)

This model is useful to perform recursive processes without using recursion.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-04-20 03:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found