Everytime I see an /o on a RE, it's usually the wrong thing. And it irks me to no end when it's used on REs that have no variables in them. It's a maintenance nightmare waiting to happen.

Imagine a RE with /o and no variables buried in a module that's part of a much larger application. In the future, some enterprising programmer decides that the RE would be better off with a $variable than what's already there but he forgets to remove the /o (or it may be so far removed from where he added the $variable, that it's not immediately visible (/x is both blessing and curse :)). Everything will work fine as long as the routine that uses that RE is called exactly once per execution of the program. The moment you put it in a loop surprising things may happen. But you may not even notice anything is wrong for a while. And tracking it down to that one little /o modifier could take ages!

BTW, something like the above actually happened to me several years ago, but I was both the person who created the RE and the future enterprising programmer. :-)


In reply to Re: /o of any help? by duff
in thread //o of any help? by Dismas

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.