Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: What's wrong with this grep?

by ikegami (Patriarch)
on Nov 07, 2009 at 09:35 UTC ( #805630=note: print w/replies, xml ) Need Help??


in reply to What's wrong with this grep?

And then there's File::Find::Rule
use File::Find::Rule qw( ); my @files = File::Find::Rule ->name( qr/^\d{8}\.\d{6}\.host\d\.\d{1,6}$/ ) ->file() ->maxdepth(1) ->in( $path );

The advantage is that you get qualified file names.

It's cheaper to execute a regex match than to check if a file is a plain file, so I reversed the order of the tests.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2023-02-07 18:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (40 votes). Check out past polls.

    Notices?