in reply to Re^2: ppk
in thread ppk

the regexp only needs to be compiled once
You gotta read the rest of the text right around there. I'd quote it, but I don't have my camel with me (I'm on a trip). But the perlop manpage says:
PATTERN may contain variables, which will be interpolat +ed (and the pattern recompiled) every time the pattern search i +s evalu- ated, except for when the delimiter is a single quote. + (Note that $(, $), and $| are not interpolated because they l +ook like end-of-string tests.) If you want such a pattern to be + com- piled only once, add a "/o" after the trailing delimite +r. This avoids expensive run-time recompilations, and is useful + when the value you are interpolating won't change over the l +ife of the script. However, mentioning "/o" constitutes a pro +mise that you won't change the variables in the pattern. If + you change them, Perl won't even notice. See also "qr/STRING/imosx".
Thus, /o is useful only when there are variables in the pattern. And you had no patterns with variables!

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^4: ppk
by northwind (Hermit) on Apr 18, 2005 at 14:18 UTC

    Doh!

    I just looked /o up in my camel book.  For future reference, the text in question is on pg. 148.