From 88044e374eea1888cf93fd6d84d6a2ebf61df2f3 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Thu, 27 Dec 2007 20:44:26 +0000 Subject: [PATCH] Localize $\ before changing it, so as not to affect print statements in the rest of the test. p4raw-id: //depot/perl@32746 --- t/op/pat.t | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/t/op/pat.t b/t/op/pat.t index 7d03eb6..ed273c2 100755 --- a/t/op/pat.t +++ b/t/op/pat.t @@ -3074,12 +3074,15 @@ ok("A" =~ /\p{AsciiHexAndDash}/, "'A' is AsciiHexAndDash"); ok($a !~ /^\C{4}y/, q{don't match \C{4}y}); } -$_ = 'aaaaaaaaaa'; -utf8::upgrade($_); chop $_; $\="\n"; -ok(/[^\s]+/, "m/[^\s]/ utf8"); -ok(/[^\d]+/, "m/[^\d]/ utf8"); -ok(($a = $_, $_ =~ s/[^\s]+/./g), "s/[^\s]/ utf8"); -ok(($a = $_, $a =~ s/[^\d]+/./g), "s/[^\s]/ utf8"); +{ + local $\; + $_ = 'aaaaaaaaaa'; + utf8::upgrade($_); chop $_; $\="\n"; + ok(/[^\s]+/, "m/[^\s]/ utf8"); + ok(/[^\d]+/, "m/[^\d]/ utf8"); + ok(($a = $_, $_ =~ s/[^\s]+/./g), "s/[^\s]/ utf8"); + ok(($a = $_, $a =~ s/[^\d]+/./g), "s/[^\s]/ utf8"); +} ok("\x{100}" =~ /\x{100}/, "[perl #15397]"); ok("\x{100}" =~ /(\x{100})/, "[perl #15397]"); -- 2.7.4