note
rsFalse
For complete picture I want to share findings that this warning <i>does</i> appear if (1) right side of an assignment '=' operator contains a "constant" (i.e. number, string), except 'undef'; And the warning <i>does not</i> appear if (2) the left side of an assignment operator '=' is enclosed with parentheses or if it is an array. I think it is desired behavior. Of course if some coder have wanted to compare his array with a number (e.g. @_ == 5, i.e. if a number of elements of an array equals to 5) and he accidentally put one '=' instead of '==', warning won't appear; And example:<br>
<code>
perl -wle '@_ = -1 .. 3; for( @_ ){ print $_; ( ) = 0 or last }'
</code>
OUTPUT:
<code>
-1
0
1
2
3
</code>
No warning.<br>
<small>Note that 'last' never executed because of: an assignment operator works as "list assignment operator" (because of parentheses on the left side of the '='), and an operator 'or' asked for scalar context. In scalar context list assignment operator returns a number of elements of the right side (i.e. one element: '0').</small>
11127970
11127970