Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Fast/efficient way of check if a string in an strArr is contained in a line

by dragonchild (Archbishop)
on Nov 12, 2008 at 01:05 UTC ( #723041=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    foo.*bar
    \w+\d+\s+\d+:\d$
    
  2. or download this
    my @skips = get_skips(); # However you get them
    my $skip_regex = join '|', map { "(?:${_})" } @skips;
    ...
        next if /$skip_regex/;
        # Now you've checked everything.
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2014-09-22 09:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (186 votes), past polls