summaryrefslogtreecommitdiff
path: root/t/op
diff options
context:
space:
mode:
authorBrian Fraser <fraserbn@gmail.com>2012-05-25 02:44:20 -0300
committerFather Chrysostomos <sprout@cpan.org>2012-05-25 08:28:54 -0700
commit760209f8136cbd716bfb8a01d6911547c2dc9f1e (patch)
treed6313e854fdfd6401d69b707039853a27f10924d /t/op
parent2a53d3314d380af5ab5283758219417c6dfa36e9 (diff)
downloadperl-760209f8136cbd716bfb8a01d6911547c2dc9f1e.tar.gz
Fix for [perl #8931], call magic only once for join's first arg.
Diffstat (limited to 't/op')
-rw-r--r--t/op/tie.t18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/op/tie.t b/t/op/tie.t
index 9301bb33a6..fcbf7a5830 100644
--- a/t/op/tie.t
+++ b/t/op/tie.t
@@ -1259,3 +1259,21 @@ $h{i}{j} = 'k';
print $h{i}{j}, "\n";
EXPECT
k
+########
+
+# [perl #8931] FETCH for tied $" called an odd number of times.
+use strict;
+my $i = 0;
+sub A::TIESCALAR {bless [] => 'A'}
+sub A::FETCH {print ++ $i, "\n"}
+my @a = ("", "", "");
+
+tie $" => 'A';
+"@a";
+
+$i = 0;
+tie my $a => 'A';
+join $a, 1..10;
+EXPECT
+1
+1