summaryrefslogtreecommitdiff
path: root/t/op/substr.t
diff options
context:
space:
mode:
authorAdrian M. Enache <enache@rdslink.ro>2003-08-03 21:00:05 +0300
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-08-03 22:26:10 +0000
commit6214ab63745c28e26e752f88d98bf89671cabc77 (patch)
tree877e9ff1583c080792db2148f4e6f12db37504ca /t/op/substr.t
parent7eb03357e6e31f7e9e759242eb85abc02adea5cf (diff)
downloadperl-6214ab63745c28e26e752f88d98bf89671cabc77.tar.gz
Re: [perl #23207] persistant sideffect involving bitwise xor and substr
Message-ID: <20030803150005.GA1319@ratsnest.hole> p4raw-id: //depot/perl@20462
Diffstat (limited to 't/op/substr.t')
-rwxr-xr-xt/op/substr.t12
1 files changed, 11 insertions, 1 deletions
diff --git a/t/op/substr.t b/t/op/substr.t
index 17f86e3e63..533f1a5bc4 100755
--- a/t/op/substr.t
+++ b/t/op/substr.t
@@ -1,6 +1,6 @@
#!./perl
-print "1..175\n";
+print "1..176\n";
#P = start of string Q = start of substr R = end of substr S = end of string
@@ -592,3 +592,13 @@ ok 174, $x eq "\x{100}\x{200}\xFFb";
$r[$_] = \ substr $s, $_, 1 for (0, 1);
ok 175, join("", map { $$_ } @r) eq "ab";
}
+
+# [perl #23207]
+{
+ sub ss {
+ substr($_[0],0,1) ^= substr($_[0],1,1) ^=
+ substr($_[0],0,1) ^= substr($_[0],1,1);
+ }
+ my $x = my $y = 'AB'; ss $x; ss $y;
+ ok 176, $x eq $y;
+}