Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: get list of files matching part of file name

by Anonymous Monk
on Jul 11, 2012 at 17:02 UTC ( #981201=note: print w/replies, xml ) Need Help??


in reply to get list of files matching part of file name

use File::Find::Rule; my @filenames = qw[ sample.txt sample123.txt ]; my $reFilenames = join '|', map quotemeta, @filenames; $reFilenames = qr/$reFilenames/i; my @files = find( 'file' => 'name' => $reFilenames, 'maxdepth' => 1, 'in' => $dir );

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2016-09-29 17:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (557 votes). Check out past polls.