summaryrefslogtreecommitdiff
path: root/t/op/gv.t
diff options
context:
space:
mode:
Diffstat (limited to 't/op/gv.t')
-rw-r--r--t/op/gv.t15
1 files changed, 14 insertions, 1 deletions
diff --git a/t/op/gv.t b/t/op/gv.t
index 32afdff69b..b8363d2454 100644
--- a/t/op/gv.t
+++ b/t/op/gv.t
@@ -12,7 +12,7 @@ BEGIN {
use warnings;
-plan( tests => 219 );
+plan( tests => 220 );
# type coersion on assignment
$foo = 'foo';
@@ -783,6 +783,19 @@ EOF
}}->($h{k});
}
+# [perl #77928] Glob slot assignment and set-magic
+{
+ package Readonly::Alias;
+ sub TIESCALAR { bless \(my $x = \pop) }
+ sub FETCH { $${$_[0]} }
+ sub STORE { die "Assignment to read-only value" }
+ package main;
+ tie my $alias, "Readonly::Alias", my $var;
+ $var = *bength;
+ # Now modify a glob slot, not the alias itself:
+ ok(scalar eval { *$alias = [] }, 'glob slot assignment skips set-magic');
+}
+
__END__
Perl
Rules