<?xml version="1.0" encoding="windows-1252"?>
<node id="462197" title="Re^3: Pimp My RegEx" created="2005-05-31 16:02:38" updated="2005-08-06 02:32:42">
<type id="11">
note</type>
<author id="373533">
jhourcle</author>
<data>
<field name="doctext">
&lt;p&gt;Sometimes, a comment will work just as well, without the overhead.  Consider the following:&lt;/p&gt;

&lt;code&gt;local $/; # INPUT_RECORD_SEPARATOR&lt;/code&gt;

&lt;p&gt;As another option, in the documenation for 'English', there's a suggestion to use:&lt;/p&gt;
&lt;code&gt;use English qw( -no_match_vars ) ;&lt;/code&gt;
&lt;p&gt;to prevent the problems mentioned.&lt;/p&gt;

&lt;p&gt;As for the 'evil variables', the following note is in 'perldoc perlre':&lt;/p&gt;&lt;blockquote&gt;       WARNING: Once Perl sees that you need one of $&amp;, $`, or $' anywhere in
       the program, it has to provide them for every pattern match.  This may
       substantially slow your program.  Perl uses the same mechanism to produce $1, $2, etc, so you also pay a price for each pattern that contains capturing parentheses.  (To avoid this cost while retaining the
       grouping behaviour, use the extended regular expression "(?: ... )"
       instead.)  But if you never use $&amp;, $` or $', then patterns without
       capturing parentheses will not be penalized.  So avoid $&amp;, $', and $`
       if you can, but if you can't (and some algorithms really appreciate
       them), once you've used them once, use them at will, because you've
       already paid the price.  As of 5.005, $&amp; is not so costly as the other
       two.&lt;/blockquote&gt;</field>
<field name="root_node">
462148</field>
<field name="parent_node">
462170</field>
</data>
</node>
