Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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;


Comment on Re^2: How to Get the Last Subdirectories
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://828159]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2014-08-28 14:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (263 votes), past polls