summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-10-25 14:21:57 -0700
committerFather Chrysostomos <sprout@cpan.org>2010-10-25 14:21:57 -0700
commit0936ef8b60a303fb904c7a44b7e4f55e8191503c (patch)
treead517d97ba8e7a827b1fd4f15ee5f148cf090252
parent88863a5d0ed0c65ebd8d25f01dd2e6a1b38578ac (diff)
downloadperl-0936ef8b60a303fb904c7a44b7e4f55e8191503c.tar.gz
[perl #77812] Globs in tied scalars can be reified if STORE dies
This commit just adds tests. This was fixed by 2acc3314e31a9.
-rw-r--r--t/op/gv.t16
1 files changed, 15 insertions, 1 deletions
diff --git a/t/op/gv.t b/t/op/gv.t
index 87624696ce..d8450abb09 100644
--- a/t/op/gv.t
+++ b/t/op/gv.t
@@ -12,7 +12,7 @@ BEGIN {
use warnings;
-plan( tests => 225 );
+plan( tests => 226 );
# type coersion on assignment
$foo = 'foo';
@@ -817,6 +817,20 @@ pass('Can assign floats to typeglobs');
*aieee = 'pi';
pass('Can assign strings to typeglobs');
+{
+ package thrext;
+ sub TIESCALAR{bless[]}
+ sub STORE{ die "No!"}
+ sub FETCH{ no warnings 'once'; *thrit }
+ tie my $a, "thrext";
+ () = "$a"; # do a fetch; now $a holds a glob
+ eval { *$a = sub{} };
+ untie $a;
+ eval { $a = "bar" };
+ ::is $a, "bar",
+ "[perl #77812] Globs in tied scalars can be reified if STORE dies"
+}
+
__END__
Perl
Rules