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 |