Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Need help with File::Find

by toadi (Chaplain)
on Feb 26, 2003 at 15:25 UTC ( #238792=note: print w/ replies, xml ) Need Help??


in reply to Need help with File::Find

my (@TOP) = # top level directories qw(/www); sub PRUNE { # don't search these dirs ## $_[0] is basename, $_[1] is full path $_[0] =~ /private/; } sub IGNORE { # don't notice these files ## $_[0] is basename, $_[1] is full path $_[0] =~ /^\.|~$|\.(gif|jpe?g)$/; } find (sub { return $File::Find::prune = 1 if PRUNE $_, $File::Find::name; return unless -f; # only files return if IGNORE $_, $File::Find::name; }, @TOP);

Stolen from merlyn long time ago, but I use it all the time for this situation.

--
My opinions may have changed,
but not the fact that I am right


Comment on Re: Need help with File::Find
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2015-07-08 03:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (94 votes), past polls