This was supposed to have been fixed by
2acc3314e31a9, but the code it
added was in the wrong spot. (This is the code that makes *{} return a
new glob if its argument is FAKE.)
Consequently, local *$foo was localising $foo, not *$foo.
This changes the order of the statements and adds a test.
if (sv) SvFAKE_off(sv);
}
}
- if (PL_op->op_private & OPpLVAL_INTRO)
- save_gp(MUTABLE_GV(sv), !(PL_op->op_flags & OPf_SPECIAL));
if (sv && SvFAKE(sv)) {
SV *newsv = sv_newmortal();
sv_setsv_flags(newsv, sv, 0);
SvFAKE_off(newsv);
- SETs(newsv);
+ sv = newsv;
}
- else SETs(sv);
+ if (PL_op->op_private & OPpLVAL_INTRO)
+ save_gp(MUTABLE_GV(sv), !(PL_op->op_flags & OPf_SPECIAL));
+ SETs(sv);
RETURN;
}
use warnings;
-plan( tests => 230 );
+plan( tests => 231 );
# type coersion on assignment
$foo = 'foo';
*$glob = *foo;
}, "Assigning a glob to a glob-with-sub that has lost its stash warks";
+{
+ package Tie::Alias;
+ sub TIESCALAR{ bless \\pop }
+ sub FETCH { $${$_[0]} }
+ sub STORE { $${$_[0]} = $_[1] }
+ package main;
+ tie my $alias, 'Tie::Alias', my $var;
+ no warnings 'once';
+ $var = *galobbe;
+ {
+ local *$alias = [];
+ $var = 3;
+ is $alias, 3, "[perl #77926] Glob reification during localisation";
+ }
+}
__END__
Perl