Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: Multiple regex against files with speed

by jeffa (Bishop)
on Apr 28, 2004 at 13:11 UTC ( #348809=note: print w/ replies, xml ) Need Help??

in reply to Multiple regex against files with speed

How about not reinventing a perfectly round wheel and adding File::Basename to your problem? Or even better --- have you seen File::Find::Rule yet?

my @files = File::Find::Rule ->file() ->name( '*.doc', '*.xls', '*.ppt' ) ->in( @DIRS ) ;

crabbdean just pointed out File::Find memory leak to me.


(the triplet paradiddle with high-hat)

Comment on Re: Multiple regex against files with speed
Download Code
Replies are listed 'Best First'.
Re: Re: Multiple regex against files with speed
by crabbdean (Pilgrim) on Apr 28, 2004 at 13:35 UTC
    The module I've build already breaks the full file name into 4 pieces - a relative path, base directory, fullfile name and filename. So I've got that bit nicely. The problem with the "File::Find::Rule" is that it utilises the "File::Find" which I'm trying to avoid. Unfortunately considering "File::Find" is a core Perl module it means re-inventing the wheel. Ho hum! Although I do like the interface used on some of the "File::Find::Rule" methods. I have a read through his code.

    The Funkster of Mirth
    Programming these days takes more than a lone avenger with a compiler. - sam
    RFC1149: A Standard for the Transmission of IP Datagrams on Avian Carriers

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2016-02-09 02:06 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (297 votes), past polls