Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^3: Problem with pre-compiled regex

by LanX (Saint)
on Jan 17, 2012 at 15:14 UTC ( [id://948334]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Problem with pre-compiled regex
in thread Problem with pre-compiled regex

>but shouldn't the pre-compiled regex run faster

Not necessarily From perlop

Since Perl may compile the pattern at the moment of execution of qr() operator, using qr() may have speed advantages in some situations,...

And not any more as often as it used to be!

...Perl has many other internal optimizations, ...

(emphasizes added)

UPDATE: Furthermore in both your code examples the regexes are just compiled and used once.

Cheers Rolf

Replies are listed 'Best First'.
Re^4: Problem with pre-compiled regex
by JavaFan (Canon) on Jan 17, 2012 at 16:34 UTC
    Actually, the regexes are used twice eacg - they first both match, then fail.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-03-29 00:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found