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

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

by Zaxo (Archbishop)
on Jun 15, 2004 at 03:46 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://366760]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-20 05:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found