Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: grep with looped tests

by betterworld (Curate)
on Jun 06, 2014 at 15:31 UTC ( [id://1089044]=note: print w/replies, xml ) Need Help??


in reply to grep with looped tests

$final = 0 if ( $r );

You need to change $r to $something =~ $r; Using a regex variable as an expression by itself will not do any matching.

It might be more efficient to drop the loop and build a combined expression like

$something !~ /$r1|$r2|$r3|$r4|.../;
Maybe Regexp::Optimizer can make that long expression even faster.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2025-12-09 08:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (88 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.