summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-11-20 09:33:44 -0800
committerFather Chrysostomos <sprout@cpan.org>2010-11-20 18:15:16 -0800
commitd8906c052fcf764bce3ec89556a62718884c9ac4 (patch)
tree1b7da28cf328da3f05d9e03417a14e5d8f64bf93 /t
parent265d2e8e39f42f720939f85c9ddd11ac402bf79b (diff)
downloadperl-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.t17
1 files changed, 16 insertions, 1 deletions
diff --git a/t/op/gv.t b/t/op/gv.t
index f04bda0575..862a0cf451 100644
--- a/t/op/gv.t
+++ b/t/op/gv.t
@@ -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