Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: matching elements in a list in a logical OR fashion

by Zaxo (Archbishop)
on Jun 15, 2004 at 03:46 UTC ( #366760=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $re = do {
        local $" = '|';
        qr/@array/;
    ...
    if ($bigstring =~ /$re/ ) {
        #...
    }
    
  2. or download this
    my $re = do {
        local $" = '|';
        qr/@{[map { quotemeta } @array]}/;
    };
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2014-08-29 14:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (280 votes), past polls