This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
RT #4682: given() didn't scope $_ correctly
authorDavid Mitchell <davem@iabyn.com>
Tue, 6 Sep 2011 11:16:23 +0000 (12:16 +0100)
committerDavid Mitchell <davem@iabyn.com>
Tue, 6 Sep 2011 11:21:21 +0000 (12:21 +0100)
commit87e4a53a894984d98bc11df391f89db73212de5e
tree9e5b6b48af12325ae3c37f035c35f24438d8c2a0
parentf5f19483eb9a5629cd2db0902731ca0b471e0adc
RT #4682: given() didn't scope $_ correctly

given(expr) {...} behaves similarly to { my $_ = expr; ...},
except that, prior to this commit, it wasn't doing the SAVECLEARSV()
that pp_padsv would do.  This meant that $_ was still marked as stale
while in scope, and wasn't getting cleared at the end of scope.
pp_ctl.c
t/op/switch.t