diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-07-26 10:52:48 +0200 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2010-07-26 10:52:48 +0200 |
commit | f71f472facac5b530b24a8ff8a79a629776411e0 (patch) | |
tree | 84fec754d1794c9189e66e4fa5d19c56d0fc92af /t | |
parent | 0fe688f528b0e1b5bef6fb30d5e45316430e8a41 (diff) | |
download | perl-f71f472facac5b530b24a8ff8a79a629776411e0.tar.gz |
[perl #75656] lvalue subs don't copy on write
The attached patch teaches pp_leavesublv about kine.
For the record, a binary search points its digit at:
From: Nicholas Clark <nick@ccl4.org>
Date: Mon, 6 Jun 2005 09:08:45 +0000 (+0000)
Subject: Shared hash key scalars can be safely copied as shared hash key scalars
Shared hash key scalars can be safely copied as shared hash key scalars all the time.
Diffstat (limited to 't')
-rw-r--r-- | t/op/sub_lval.t | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/t/op/sub_lval.t b/t/op/sub_lval.t index c20ffac7be..f754782148 100644 --- a/t/op/sub_lval.t +++ b/t/op/sub_lval.t @@ -3,7 +3,7 @@ BEGIN { @INC = '../lib'; require './test.pl'; } -plan tests=>71; +plan tests=>73; sub a : lvalue { my $a = 34; ${\(bless \$a)} } # Return a temporary sub b : lvalue { ${\shift} } @@ -570,3 +570,8 @@ Execution of - aborted due to compilation errors. lval_decl = 5; is($x, 5, "subroutine declared with lvalue before definition retains lvalue. [perl #68758]"); } + +sub fleen : lvalue { $pnare } +$pnare = __PACKAGE__; +ok eval { fleen = 1 }, "lvalues can return COWs (CATTLE?) [perl #75656]";\ +is $pnare, 1, 'and returning CATTLE actually works'; |