Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 pondering the Monastery: (11)
As of 2016-02-12 15:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?





    Results (406 votes), past polls