By using find_runcv_where both for formats and my subs nested in inner
clonable subs, we can simplify the code.
It happens to make this work ($x is visible):
use 5.01;
sub not_lexical8 {
my sub foo;
foo();
sub not_lexical9 {
my sub bar {
my $x = 'khaki car keys for the khaki car';
not_lexical8();
sub foo { warn $x }
}
bar()
}
}
not_lexical9();
This is definitely iffy code, but if making it work makes the imple-
mentation simpler, so why not?
*/
if (!outside) {
- if (SvTYPE(proto) == SVt_PVCV)
- {
+ if (CvWEAKOUTSIDE(proto))
outside = find_runcv(NULL);
- if (!CvANON(proto)) {
- if (!CvPADLIST(outside) ||
- CvPADLIST(outside)->xpadl_id != protopadlist->xpadl_outid)
- outside = CvOUTSIDE(proto);
- if (!CvPADLIST(outside) ||
- CvPADLIST(outside)->xpadl_id != protopadlist->xpadl_outid)
- outside = NULL;
- }
- }
else {
outside = CvOUTSIDE(proto);
if ((CvCLONE(outside) && ! CvCLONED(outside))
*bar::like = *like;
}
no warnings 'deprecated';
-plan 117;
+plan 118;
# -------------------- our -------------------- #
is $@, "Undefined subroutine &x called at $f line $l.\n",
'Vivified sub is correctly named';
}
+sub not_lexical10 {
+ my sub foo;
+ foo();
+ sub not_lexical11 {
+ my sub bar {
+ my $x = 'khaki car keys for the khaki car';
+ not_lexical10();
+ sub foo {
+ is $x, 'khaki car keys for the khaki car',
+ 'mysubs in inner clonables use the running clone of their CvOUTSIDE'
+ }
+ }
+ bar()
+ }
+}
+not_lexical11();
# -------------------- Interactions (and misc tests) -------------------- #