On Tue, Oct 13, 2009 at 7:50 PM, Yitzchak Scott-Thoennes <span dir="ltr"><<a href="mailto:sthoenna@efn.org" target="_blank">sthoenna@efn.org</a>></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 '^') 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>
> * punctuation like $$<br>
> * EXCEPT the variables $(, $|, $)<br>
> $ that hasn'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's guess.<br></blockquote></div><div><br>If you want to know a bit about what "guess" means there, just read the code.<br><br>But I'm curious of ways to force Perl's hand in either direction. I'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 "weigh":<br><br><a href="http://perl5.git.perl.org/perl.git?a=search&h=HEAD&st=grep&s=%5Cbweigh%5Cb&sr=1" target="_blank">http://perl5.git.perl.org/perl.git?a=search&h=HEAD&st=grep&s=%5Cbweigh%5Cb&sr=1</a><br>
<br>Tye<br><br></div></div>
</div>