For regexes with variables in them, it rebuilds the machine every time it uses the regex.
IIRC it's long since this is not the case anymore. Perl's checking a regex-cache to see if it has already compiled the pattern. That's why the /o flag is almost useless now (Beware: it can produce ugly side effects if not used with care)
(Though I couldn't find it stated in the perldocs :-( ... I think I should have read it in Friedl's regex "bible")
As Ikegami already suggested, stick with qr is certainly the cleanest approach to control compilation time, even with nested regexes, so better just forget /o! ¹
Cheers Rolf
UPDATE:
(1) or better only try to remember it as a possible optimization AFTER profiling shows a bottleneck!
In reply to Re: Optimize a pluggable regex matching mechanism (/o practically deprecated)
by LanX
in thread Optimize a pluggable regex matching mechanism
by dredd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |