Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

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)

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