summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-09-22 15:46:44 +0000
committerNicholas Clark <nick@ccl4.org>2007-09-22 15:46:44 +0000
commit53a42478dbff55e7fc2f0fe0876cb4ceeaba894c (patch)
tree1cf9becd3813514075ef380eaae6b7e88b2c1e0a /t
parente47d7ad1097fe8bf25456f76aaa863c85118bca8 (diff)
downloadperl-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-xt/op/gv.t11
1 files changed, 10 insertions, 1 deletions
diff --git a/t/op/gv.t b/t/op/gv.t
index bca84e742d..5b04f8719a 100755
--- a/t/op/gv.t
+++ b/t/op/gv.t
@@ -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