in reply to Re: How to Get the Last Subdirectories
in thread How to Get the Last Subdirectories
++, nice idea. Here's a variation of your approach, making use of the postprocess option:
#!/usr/bin/perl -l use File::Find; my @dirs; find( { wanted => sub {}, postprocess => sub { push @dirs, $File::Find::dir if index $dirs[-1]||"", $File::Find::dir; }, }, '/tmp/a' ); print for @dirs;
|
---|