Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

RE: Re: matching an array of alternates

by Zoogie (Curate)
on Jun 23, 2000 at 23:54 UTC ( #19652=note: print w/ replies, xml ) Need Help??

in reply to Re: matching an array of alternates
in thread matching an array of alternates

Just wanted to point out that if the file you're searching has a lot of lines, you can gain some speed by adding the "o" option to the regex; i.e.:

print $1 if /$regex/o;
This way, the regular expression only has to be compiled once.

- Zoogie

Comment on RE: Re: matching an array of alternates
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (11)
As of 2015-10-06 19:32 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (159 votes), past polls