<?xml version="1.0" encoding="windows-1252"?>
<node id="828159" title="Re^2: How to Get the Last Subdirectories" created="2010-03-11 18:53:47" updated="2010-03-11 18:53:47">
<type id="11">
note</type>
<author id="580097">
almut</author>
<data>
<field name="doctext">
&lt;p&gt; ++, nice idea.&amp;nbsp; Here's a variation of your approach, making
use of the &lt;c&gt;postprocess&lt;/c&gt; option: &lt;/p&gt;
&lt;c&gt;
#!/usr/bin/perl -l
use File::Find;

my @dirs; 
find(
    {   wanted      =&gt; sub {},
        postprocess =&gt; sub {
            push @dirs, $File::Find::dir
              if index $dirs[-1]||"", $File::Find::dir;
        },
    },
    '/tmp/a'
);

print for @dirs;
&lt;/c&gt;
</field>
<field name="root_node">
828135</field>
<field name="parent_node">
828145</field>
</data>
</node>
