In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/5f3e44b689cab8bd7cec81aa6fc21c2ec5b3489f?hp=e1137bc782e702f287ec7909f121d66bfb4707ba>
- Log ----------------------------------------------------------------- commit 5f3e44b689cab8bd7cec81aa6fc21c2ec5b3489f Author: David Mitchell <[email protected]> Date: Mon Jun 7 22:18:35 2010 +0100 document revert of 'local $tied' change M pod/perl5132delta.pod commit 89adf4e8e0de17fedf78328b32920f47635850d0 Author: David Mitchell <[email protected]> Date: Mon Jun 7 22:11:42 2010 +0100 Revert "make 'local $tied' untied" This reverts commit 191ad7eff570fc96c93993e4358f83e2033365d6. Some modules (e.g. File::chdir) relied on the current behaviour of local $tied_scalar, so lets leave things as-is for now. See http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2010-05/msg00627.html M mg.c M t/op/local.t ----------------------------------------------------------------------- Summary of changes: mg.c | 1 - pod/perl5132delta.pod | 8 ++++---- t/op/local.t | 29 +---------------------------- 3 files changed, 5 insertions(+), 33 deletions(-) diff --git a/mg.c b/mg.c index 7027605..052fee5 100644 --- a/mg.c +++ b/mg.c @@ -179,7 +179,6 @@ S_is_container_magic(const MAGIC *mg) case PERL_MAGIC_rhash: case PERL_MAGIC_symtab: case PERL_MAGIC_tied: /* treat as value, so 'local @tied' isn't tied */ - case PERL_MAGIC_tiedscalar: /* so 'local $scalar' isn't tied */ return 0; default: return 1; diff --git a/pod/perl5132delta.pod b/pod/perl5132delta.pod index 9551f4a..ea53bee 100644 --- a/pod/perl5132delta.pod +++ b/pod/perl5132delta.pod @@ -19,11 +19,11 @@ XXX Any important notices here =head1 Incompatible Changes -XXX For a release on a stable branch, this section aspires to be: - - There are no changes intentionally incompatible with 5.XXX.XXX. If any - exist, they are bugs and reports are welcome. +=head2 localised tied scalars are tied again. +The change in behaviour in 5.13.1 of localising tied scalar values has +been reverted to the existing 5.12.0 and earlier behaviour (the change for +arrays and hashes remains). =head1 Core Enhancements diff --git a/t/op/local.t b/t/op/local.t index fababb7..f664df4 100644 --- a/t/op/local.t +++ b/t/op/local.t @@ -5,7 +5,7 @@ BEGIN { @INC = qw(. ../lib); require './test.pl'; } -plan tests => 310; +plan tests => 306; my $list_assignment_supported = 1; @@ -781,33 +781,6 @@ like( runperl(stderr => 1, 'index(q(a), foo);' . 'local *g=${::}{foo};print q(ok);'), "ok", "[perl #52740]"); -# localising a tied scalar should give you an untied var -{ - package TS; - sub TIESCALAR { bless \my $self, shift } - - my $s; - sub FETCH { $s .= ":F=${$_[0]}"; ${$_[0]} } - sub STORE { $s .= ":S($_[1])"; ${$_[0]} = $_[1]; } - - package main; - tie $ts, 'TS'; - $ts = 1; - { - $s .= ':L1'; - local $ts; - $s .= ':L2'; - is($ts, undef, 'local tied scalar initially undef'); - $ts = 2; - is($ts, 2, 'local tied scalar now has a value'); - $s .= ':E'; - } - is($ts, 1, 'restored tied scalar has correct value'); - $ts = 3; - is($s, ':S(1):L1:F=1:L2:E:F=1:S(3)', - "local tied scalar shouldn't call methods"); -} - # Keep this test last, as it can SEGV { local *@; -- Perl5 Master Repository
