summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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