On Tue, Oct 13, 2009 at 7:50 PM, Yitzchak Scott-Thoennes <span dir="ltr">&lt;<a href="mailto:sthoenna@efn.org" target="_blank">sthoenna@efn.org</a>&gt;</span> wrote:<br><div class="gmail_quote"><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">
<br>
Except when in a ^-delimited regex (and not interpolated), in which case<br>
\^ means what ^ would otherwise have.<br>
<div><br></div></div>
Ditto re $-delimited regex.<br></blockquote><div><br>But it would be better if \^ meant \^ (literal &#39;^&#39;) when inside m^...^ for the sake of making m[...] reasonable.  (Did this change?  I recall first contemplating this due to someone advocating m[...].)<br>

<br></div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>
&gt; * punctuation like $$<br>
&gt; * EXCEPT the variables $(, $|, $)<br>
&gt; $ that hasn&#39;t interpolated matches:<br></div></blockquote></div><div><br>It is quite unfortunate that $] is not also an exception, at least when inside a character class.  That is probably my least favorite feature of the DWIM here.<br>

<br></div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>
</div>You left out $foo[EXPR] and $foo{EXPR}, which may interpolate $foo<br>
or may interpolate a hash or array element, depending on perl&#39;s guess.<br></blockquote></div><div><br>If you want to know a bit about what &quot;guess&quot; means there, just read the code.<br><br>But I&#39;m curious of ways to force Perl&#39;s hand in either direction.  I&#39;m also intentionally not looking at the code myself at the moment trying to answer my own question for reasons that I will leave unstated.  $temp= $foo[EXPR] beforehand, of course.  $foo(?:)[EXPR].  ${foo[EXPR]}, likely. But I suspect ${foo}[EXPR] is still a DWIM case.<br>

<br>Oh, if you want to find the code in question, I can point the &quot;weigh&quot;:<br><br><a href="http://perl5.git.perl.org/perl.git?a=search&amp;h=HEAD&amp;st=grep&amp;s=%5Cbweigh%5Cb&amp;sr=1" target="_blank">http://perl5.git.perl.org/perl.git?a=search&amp;h=HEAD&amp;st=grep&amp;s=%5Cbweigh%5Cb&amp;sr=1</a><br>

<br>Tye<br><br></div></div>
</div>