Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://376153]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2017-07-26 21:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (402 votes). Check out past polls.