[perl #3112] Stop last from returning values
authorFather Chrysostomos <sprout@cpan.org>
Fri, 20 Sep 2013 08:34:31 +0000 (01:34 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 20 Sep 2013 19:44:39 +0000 (12:44 -0700)
commit0c0c317c3b754aee8ee3ef271d17aab2fdbe5140
tree93c4ddd53821b00ca7ab91058743a48e7dcea88d
parent7497b91fbd38419c3d11a21866233566db7a3c10
[perl #3112] Stop last from returning values

In push @a, last, it can try to return the @a, copying it like a sca-
lar in the process, resulting in Bizarre copy of ARRAY in last.

In do{{&{sub{"Just another Perl hacker,\n"}},last}}, it returns "Just
another Perl hacker,\n".

The former is clearly a bug.  The latter depends on a side-effect of
the same bug.

‘last’ really should not be trying to return the values that the same
statement has accumulated so far.
pp_ctl.c
t/op/loopctl.t