Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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: (12)
As of 2014-09-19 19:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (144 votes), past polls