Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Search array of file names in directory structure

by kennethk (Abbot)
on Oct 01, 2012 at 17:34 UTC ( #996698=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $regex = do {
        my @escaped;
        push @escaped, quotemeta for @filelist;
        my $joined = join '|', @escaped;
        qr/^(?:$joined)$/;
    };
    
  2. or download this
    my $regex = '^(?:' . join('|', map quotemeta, @filelist) . ')$';
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://996698]
help
Chatterbox?
[Veltro]: Lol, think this is the best one: Why donít I just use Googleís thing? -You think thatís going to be around in 6 months?
[marto]: well, they have retired many products and services

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2018-05-24 12:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?