diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-10-25 14:21:57 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-10-25 14:21:57 -0700 |
commit | 0936ef8b60a303fb904c7a44b7e4f55e8191503c (patch) | |
tree | ad517d97ba8e7a827b1fd4f15ee5f148cf090252 | |
parent | 88863a5d0ed0c65ebd8d25f01dd2e6a1b38578ac (diff) | |
download | perl-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.t | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -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 |