Quite simply:
That's it. Why isn't it documented that they don't make a copy in rvalue context? Why would it.
If you wanted to explicitly copy the scalar, you could do a( 0+( $x && $y ) ). Then, $_[0] = 3; will modify the anonymous scalar the addition constructed.
In reply to Re: Why Perl boolean expression sometimes treated as lvalue?
by ikegami
in thread Why Perl boolean expression sometimes treated as lvalue?
by vsespb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |