From: Nicholas Clark Date: Thu, 27 Dec 2007 20:44:26 +0000 (+0000) Subject: Localize $\ before changing it, so as not to affect print statements in X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=88044e374eea1888cf93fd6d84d6a2ebf61df2f3;p=p5sagit%2Fp5-mst-13.2.git Localize $\ before changing it, so as not to affect print statements in the rest of the test. p4raw-id: //depot/perl@32746 --- 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]");