diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-09-22 15:46:44 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-09-22 15:46:44 +0000 |
commit | 53a42478dbff55e7fc2f0fe0876cb4ceeaba894c (patch) | |
tree | 1cf9becd3813514075ef380eaae6b7e88b2c1e0a /t | |
parent | e47d7ad1097fe8bf25456f76aaa863c85118bca8 (diff) | |
download | perl-53a42478dbff55e7fc2f0fe0876cb4ceeaba894c.tar.gz |
Fix bug 45607 - for the corner case *{"BONK"} = \&{"BONK"} the order
of op evaluation means that what had been a reference to a constant
can turn into a typeglob before the sassign gets to run.
p4raw-id: //depot/perl@31940
Diffstat (limited to 't')
-rwxr-xr-x | t/op/gv.t | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -12,7 +12,7 @@ BEGIN { use warnings; require './test.pl'; -plan( tests => 160 ); +plan( tests => 161 ); # type coersion on assignment $foo = 'foo'; @@ -485,6 +485,15 @@ foreach my $value ([1,2,3], {1=>2}, *STDOUT{IO}, \&ok, *STDOUT{FORMAT}) { eval "`` if 0"; is($@, '', "Can't trip up readpipe overloading"); } + +{ + die if exists $::{BONK}; + $::{BONK} = \"powie"; + *{"BONK"} = \&{"BONK"}; + eval 'is(BONK(), "powie", + "Assigment works when glob created midway (bug 45607)"); 1' + or die $@; +} __END__ Perl Rules |