diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-11-20 09:33:44 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-11-20 18:15:16 -0800 |
commit | d8906c052fcf764bce3ec89556a62718884c9ac4 (patch) | |
tree | 1b7da28cf328da3f05d9e03417a14e5d8f64bf93 /t | |
parent | 265d2e8e39f42f720939f85c9ddd11ac402bf79b (diff) | |
download | perl-d8906c052fcf764bce3ec89556a62718884c9ac4.tar.gz |
[perl #77926] Glob reification during localisation
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.
Diffstat (limited to 't')
-rw-r--r-- | t/op/gv.t | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -12,7 +12,7 @@ BEGIN { use warnings; -plan( tests => 230 ); +plan( tests => 231 ); # type coersion on assignment $foo = 'foo'; @@ -857,6 +857,21 @@ ok eval { *$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 |