Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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 wandering the Monastery: (4)
As of 2016-06-27 03:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (335 votes). Check out past polls.