Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 );


Comment on Re: get list of files matching part of file name
Download Code

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 musing on the Monastery: (7)
As of 2014-11-28 07:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (193 votes), past polls