Perl automatically does the second optimization for you - it recompiles a regex only if it contains interpolated variables.
   MeowChow                                   
               s aamecha.s a..a\u$&owag.print

In reply to Re: Re: Optimization for readability and speed (code) by MeowChow
in thread Optimization for readability and speed (code) by deprecated

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