Make scalar() propagate lvalueness
authorFather Chrysostomos <sprout@cpan.org>
Tue, 13 Dec 2011 06:29:39 +0000 (22:29 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 13 Dec 2011 16:53:45 +0000 (08:53 -0800)
commitd408447cb636e46fcb4f7fe7d0909bb351b7ba22
tree5a07e8d45558e7bd27dde0001f5f4accf8e9fa07
parent6d91e95705f053bd53d2470dff80fa5df03f7213
Make scalar() propagate lvalueness

As mentioned in ticket #24346, scalar() should not change lvalueness.
The fact that it did was a side effect of the implementation and a
bug.  foo(scalar substr(....)) should pass a substr lvalue to foo just
as it would without scalar() or with a $ prototype (which is meant to
be equivalent to scalar()).

This also makes it possible to force scalar context in list assignment
to lvalue subroutines, as in (foo(), scalar bar()) = @list.
op.c
t/op/substr.t