Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 exploiting the Monastery: (8)
As of 2016-07-28 13:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (255 votes). Check out past polls.