$' and friends aren't deprecated. Deprecation means it's marked as "may disappear from the language".

Furthermore, $' and friends aren't bad. They are very convenient. They come with a price - there's a performance impact. But we're willing to pay a huge performance impact on picking Perl over C, because Perl is much more convenient. It's the same with $' and friends. I use them a lot. Not for long running programs that possible do thousands of matches on long strings, but I write a lot of programs whose running time is I/O bound, and which do just a handful of matches against short strings. I use $' and $` in those.

It's just silly to consider $' and friends as evil. As a child, everything is black and white. Things are good, or evil. As a programmer, you do not have that luxery. Only a few constructs or techniques are really evil or very good. Everything else is a tradeoff. Good programmers aren't judged by what they know - but how they do their trade-offs.


In reply to Re^2: Impact of special variables on regex match performance by JavaFan
in thread Impact of special variables on regex match performance by roubi

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.