Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: Directories without recursion and exceptions

by merlyn (Sage)
on Feb 21, 2006 at 14:43 UTC ( [id://531706]=note: print w/replies, xml ) Need Help??


in reply to Re: Directories without recursion and exceptions
in thread Directories without recursion and exceptions

Not sure if FFR can do this directly, but my File::Finder can also do:
use File::Finder; my @search = qw( /usr/local/ ); my @abs_dirs = qw ( /usr/local/share/locale ); my %abs_dirs; @abs_dirs{@abs_dirs} = (); my @dirs = File::Finder->type('d')->eval(sub { not exists $abs_dirs{$F +ile::Find::name}})->in(@search);

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^3: Directories without recursion and exceptions
by davidrw (Prior) on Feb 21, 2006 at 15:08 UTC
    All in one w/FFR:
    my @files = File::Find::Rule->directory()->exec( sub { ! exists $abs +_dirs{$_[2]} } )->in( @search );
    I was actually looking at both FFR and File::Finder for this task .. codes comes out pretty similar for both :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-03-28 16:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found