Perl Monk, Perl Meditation | |
PerlMonks |
Re: Performance penalty of using qr//by Jenda (Abbot) |
on Dec 22, 2017 at 00:08 UTC ( [id://1206009]=note: print w/replies, xml ) | Need Help?? |
IMNSHO, there's no point in using qr// for regexps that are not built out of string in variables. If the whole regex is static, Perl is clever enough to optimize it. It's only if the code contains things like $foo =~ /bar$baz\wbat/ that Perl needs some help in deciding whether it needs to compile the regex again or whether it can reuse the one from the previous iteration. Jenda
In Section
Seekers of Perl Wisdom
|
|