Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: line by line match on an array of strings

by jbert (Priest)
on Jan 09, 2008 at 10:42 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://661306]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-24 22:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found