Don't ask to ask, just ask | |
PerlMonks |
Re^3: Problem with pre-compiled regexby LanX (Saint) |
on Jan 17, 2012 at 15:14 UTC ( [id://948334]=note: print w/replies, xml ) | Need Help?? |
>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
In Section
Seekers of Perl Wisdom
|
|