Re: FAQ 6.9 What is "/o" really for?



PerlFAQ Server wrote:

> Using a variable in a regular expression match forces a re-evaluation
> (and perhaps recompilation) each time the regular expression is
> encountered.

Hmm, isn't this info outdated? At least the latest versions of Perl (and
already since 5.6.x at least, IIRC), do cache the string value and don't
recompile the regex is it hasn't changed. In many of my tests, /$pat/o
was *not* faster than just /$pat/, with an unchanged variable.

Anyway, I'd like to see the things I mention here off the top of my
head, incorporated into this FAQ entry.

--
Bart.
.



Relevant Pages

  • Re: FAQ 6.9 What is "/o" really for?
    ... >> Using a variable in a regular expression match forces a re-evaluation ... >> (and perhaps recompilation) each time the regular expression is ... Subscribe to The Perl Review: http://www.theperlreview.com ...
    (comp.lang.perl.misc)
  • Re: FAQ 6.9 What is "/o" really for?
    ... > the first time it's used. ... > regular expression, and in fact, the pattern was compiled into ... AFAIK, and from a certain version of Perl, the regex engine can ... so that even without '/o' the re-evaluation takes no significant ...
    (comp.lang.perl.misc)