Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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 examining the Monastery: (18)
As of 2015-07-29 16:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (265 votes), past polls