Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: How to Get the Last Subdirectories

by almut (Canon)
on Mar 11, 2010 at 23:53 UTC ( #828159=note: print w/replies, xml ) Need Help??


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;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://828159]
help
Chatterbox?
holli yawns

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2017-09-24 11:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (274 votes). Check out past polls.

    Notices?