<?xml version="1.0" encoding="windows-1252"?>
<node id="375832" title="Re: Depth Listing in Directory Traversal (one more stack)" created="2004-07-20 02:36:12" updated="2005-05-31 06:56:00">
<type id="11">
note</type>
<author id="22609">
tye</author>
<data>
<field name="doctext">
&lt;p&gt;
Where you &lt;code&gt; push @{ $self-&gt;{dirs} },...&lt;/code&gt; you need to add &lt;code&gt;push @{ $self-&gt;{levels} }, 1+$self-&gt;{level};&lt;/code&gt;.  When you [shift] off of &lt;code&gt;$self-&gt;{dirs}&lt;/code&gt;, also do &lt;code&gt;$self-&gt;{level} = shift @{ $self-&gt;{levels} };&lt;/code&gt;.
&lt;/p&gt;&lt;p&gt;
You can do it in more memory-efficient ways but the added complexity seems not worth it.
&lt;/p&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-22609"&gt;&lt;p align="right"&gt;
- [tye]&lt;tt&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/tt&gt;
&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
375782</field>
<field name="parent_node">
375782</field>
</data>
</node>
