Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2016-09-24 21:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (462 votes). Check out past polls.