Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Depth Listing in Directory Traversal (one more stack)

by tye (Sage)
on Jul 20, 2004 at 06:36 UTC ( #375832=note: print w/replies, xml ) Need Help??

in reply to Depth Listing in Directory Traversal

Where you  push @{ $self->{dirs} },... you need to add push @{ $self->{levels} }, 1+$self->{level};. When you shift off of $self->{dirs}, also do $self->{level} = shift @{ $self->{levels} };.

You can do it in more memory-efficient ways but the added complexity seems not worth it.

- tye        

Replies are listed 'Best First'.
Re^2: Depth Listing in Directory Traversal (one more stack)
by crabbdean (Pilgrim) on Jul 20, 2004 at 13:16 UTC
    tye you are great. :-) Love your work! ++ That worked a treat.

    You know I was part way there in that thinking process, had similar thoughts but hadn't connected the pieces. Appreciate the help.

    Thanks also to hbo that idea would have worked also but I felt this was cleaner.

    The Funkster of Mirth
    Programming these days takes more than a lone avenger with a compiler. - sam
    RFC1149: A Standard for the Transmission of IP Datagrams on Avian Carriers

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2018-04-23 23:18 GMT
Find Nodes?
    Voting Booth?