Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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 chanting in the Monastery: (10)
As of 2015-11-26 09:50 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (696 votes), past polls