On top of what already has been said, lose the modifiers. In your case, the
/o is pointless. In the few regexes where it may matter,
/o at best gives you a very, very tiny performance gain
*, but can easily lead to incorrect code. As for the
/e, it's useless here as well. It tells the operator to not use the replacement directly, but to evaluate it as code. But the result of an expression consisting of a single variable is just the value of that variable anyway.
*There used to be a more significant speed up (which only matters if you execute the same regex repeatedly), but that speed up has been made largely redundant by regex improvements made long, long time ago (around the 5.003/5.004 era, IIRC).
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.