Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2016-06-29 18:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (385 votes). Check out past polls.