Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: line by line match on an array of strings

by jbert (Priest)
on Jan 09, 2008 at 10:42 UTC ( #661306=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @typedefs = qw(...sorted list of typedefs, common ones first...);
    my @regexes = map { qr{$_} } @typedefs;
    ...
        last REGEX; # Stop looking
      }
    }
    
  2. or download this
    my @typedefs = qw(...sorted list of typedefs, common ones first...);
    # Make a big '(a|b|c|...)' regex str
    ...
    if ($line =~ $regex) {
        # found typedef so do work
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2014-07-12 12:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (239 votes), past polls