note
perlfan
<code>
if ($_ = (m/^[\$]\w/)) {
</code>
<p>
Solution pointed out below. This is an <i>assignment</i> (using <code>=</code>) clobbering <code>$_</code> with <strike>an empty array</strike> <i>the true/false result</i>. An assignment of an undefined thing evaluates to false every time. Similar to <code>if ($_ = ())</code> or <code>if ($_ = undef)</code>.
<p>Update - because I was curious:
<code>
perl -MO=Deparse,-P -e 'if($_ = (m/foo/)) { print 'hi' }'
if ($_ = /foo/) {
print hi $_;
}
-e syntax OK
</code>
<p>
A little more insight.
<p>
update 2- corrected ty
11118540
11118540