Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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.


In reply to Re^3: ppk by merlyn
in thread ppk by northwind

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-20 01:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found