Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Depth Listing in Directory Traversal

by adamk (Chaplain)
on Jul 21, 2004 at 04:26 UTC ( #376153=note: print w/ replies, xml ) Need Help??


in reply to Depth Listing in Directory Traversal

In general, when doing queue-based-recursion, just unshift onto the queue, rather than pushing.

my @queue = ( $start ) { while ( my $thing = shift @queue ) { do_something_with( $thing ); unshift @queue, $thing->children; }

I'm assuming this is what you are after?


Comment on Re: Depth Listing in Directory Traversal
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2014-07-25 21:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls