Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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 contemplating the Monastery: (5)
As of 2016-06-28 04:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (349 votes). Check out past polls.