|
|
| The stupid question is the question not asked | |
| PerlMonks |
Re: Why Perl boolean expression sometimes treated as lvalue?by ikegami (Pope) |
| on Feb 11, 2013 at 04:31 UTC ( #1018092=note: print w/ replies, xml ) | Need Help?? |
|
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 Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||