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.
if (MARK == SP) {
/* Temporaries are bad unless they happen to be elements
* of a tied hash or array */
- if (SvFLAGS(TOPs) & (SVs_TEMP | SVs_PADTMP | SVf_READONLY) &&
+ if ((SvFLAGS(TOPs) & (SVs_TEMP | SVs_PADTMP) ||
+ (SvFLAGS(TOPs) & (SVf_READONLY | SVf_FAKE))
+ == SVf_READONLY
+ ) &&
!(SvRMAGICAL(TOPs) && mg_find(TOPs, PERL_MAGIC_tiedelem))) {
LEAVE;
cxstack_ix--;
@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} }
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';