summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-08-12 03:30:07 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-08-12 03:30:07 +0000
commit169da83847a2059e4bc997fdd0d3f1afb5af3a3f (patch)
tree3d623a89f24b50d0f909587b26bb09f7b9189584
parentb0f2b690b4ba59b02c372a35658748cb0f31c38e (diff)
downloadperl-169da83847a2059e4bc997fdd0d3f1afb5af3a3f.tar.gz
Drop all the unnecessary "use utf8" clauses and some of
the unnecessary "use bytes" ones. TODO: scour the documentation for unnecessary "use utf8" and prominently display it in perldelta when the time comes. ("use utf8" should be necessary ONLY if one wants the script to be in UTF-8.) Also should be checked in some non-ASCII non-Latin-1 platform, like EBCDIC. p4raw-id: //depot/perl@11638
-rwxr-xr-xt/comp/require.t1
-rwxr-xr-xt/io/utf8.t2
-rw-r--r--t/op/concat.t3
-rwxr-xr-xt/op/each.t12
-rwxr-xr-xt/op/pat.t2
-rw-r--r--t/op/regmesg.t4
-rwxr-xr-xt/op/sprintf.t2
-rwxr-xr-xt/op/tr.t3
8 files changed, 9 insertions, 20 deletions
diff --git a/t/comp/require.t b/t/comp/require.t
index 07415610fb..103a579235 100755
--- a/t/comp/require.t
+++ b/t/comp/require.t
@@ -86,7 +86,6 @@ print "not " unless 5.5.1 gt v5.5;
print "ok ",$i++,"\n";
{
- use utf8;
print "not " unless v5.5.640 eq "\x{5}\x{5}\x{280}";
print "ok ",$i++,"\n";
diff --git a/t/io/utf8.t b/t/io/utf8.t
index 224dfd70da..0d5700dff5 100755
--- a/t/io/utf8.t
+++ b/t/io/utf8.t
@@ -9,7 +9,7 @@ BEGIN {
}
}
-no utf8; # so that the naked 8-bit chars won't gripe under use utf8
+no utf8; # needed for use utf8 not griping about the raw octets
$| = 1;
my $total_tests = 25;
diff --git a/t/op/concat.t b/t/op/concat.t
index 76074e0f28..5ae7da51b9 100644
--- a/t/op/concat.t
+++ b/t/op/concat.t
@@ -28,7 +28,6 @@ my $test = 4;
$_ = $dx = "\x{10f2}";
s/($dx)/$dx$1/;
{
- use bytes;
print "not " unless $_ eq "$dx$dx";
print "ok $test\n";
$test++;
@@ -37,7 +36,6 @@ my $test = 4;
$_ = $dx = "\x{10f2}";
s/($dx)/$1$dx/;
{
- use bytes;
print "not " unless $_ eq "$dx$dx";
print "ok $test\n";
$test++;
@@ -47,7 +45,6 @@ my $test = 4;
$_ = "\x{10f2}\x{10f2}";
s/($dx)($dx)/$1$2/;
{
- use bytes;
print "not " unless $_ eq "$dx$dx";
print "ok $test\n";
$test++;
diff --git a/t/op/each.t b/t/op/each.t
index 6dd1ceae8c..eb2dce0ce4 100755
--- a/t/op/each.t
+++ b/t/op/each.t
@@ -158,27 +158,23 @@ print "not " if exists $b{$A};
print "ok 21\n";
print "not " if exists $u{$a};
print "ok 22\n";
-print "#$b{$_}\n" for keys %b; # Used to core dump before change #8056.
+print "# $b{$_}\n" for keys %b; # Used to core dump before change #8056.
print "ok 23\n";
-print "#$u{$_}\n" for keys %u; # Used to core dump before change #8056.
+print "# $u{$_}\n" for keys %u; # Used to core dump before change #8056.
print "ok 24\n";
-use bytes ();
-
# on EBCDIC chars are mapped differently so pick something that needs encoding
# there too.
$d = pack("U*", 0xe3, 0x81, 0xAF);
-$ol = bytes::length($d);
+{ use bytes; $ol = bytes::length($d) }
print "not " unless $ol > 3;
print "ok 25\n";
%u = ($d => "downgrade");
for (keys %u) {
- use bytes;
print "not " if length ne 3 or $_ ne "\xe3\x81\xAF";
print "ok 26\n";
}
{
- use bytes;
- print "not " if length($d) != $ol;
+ { use bytes; print "not " if bytes::length($d) != $ol }
print "ok 27\n";
}
diff --git a/t/op/pat.t b/t/op/pat.t
index 270d65a2e9..bed2f376ff 100755
--- a/t/op/pat.t
+++ b/t/op/pat.t
@@ -1287,7 +1287,7 @@ print "ok 247\n";
"#latin[$latin]\nnot ok $test\n";
$test++;
$latin =~ s/stra\337e/straße/; # \303\237 after the 2nd a
- use utf8;
+ use utf8; # needed for the raw UTF-8
$latin =~ s!(s)tr(?:aß|s+e)!$1tr.!; # \303\237 after the a
}
}
diff --git a/t/op/regmesg.t b/t/op/regmesg.t
index 24f6f31f77..82f6ee9e7b 100644
--- a/t/op/regmesg.t
+++ b/t/op/regmesg.t
@@ -61,7 +61,7 @@ my @death =
'/\p{x/' => 'Missing right brace on \p{} in regex; marked by {#} in m/\p{{#}x/',
- 'use utf8; /[\p{x]/' => 'Missing right brace on \p{} in regex; marked by {#} in m/[\p{{#}x]/',
+ '/[\p{x]/' => 'Missing right brace on \p{} in regex; marked by {#} in m/[\p{{#}x]/',
'/(x)\2/' => 'Reference to nonexistent group in regex; marked by {#} in m/(x)\2{#}/',
@@ -69,7 +69,7 @@ my @death =
'/\x{1/' => 'Missing right brace on \x{} in regex; marked by {#} in m/\x{{#}1/',
- 'use utf8; /[\x{X]/' => 'Missing right brace on \x{} in regex; marked by {#} in m/[\x{{#}X]/',
+ '/[\x{X]/' => 'Missing right brace on \x{} in regex; marked by {#} in m/[\x{{#}X]/',
'/[[:barf:]]/' => 'POSIX class [:barf:] unknown in regex; marked by {#} in m/[[:barf:]{#}]/',
diff --git a/t/op/sprintf.t b/t/op/sprintf.t
index 89992d62d0..01b36fe7e5 100755
--- a/t/op/sprintf.t
+++ b/t/op/sprintf.t
@@ -4,7 +4,7 @@
# doubles (if supported), of machine-specific short and long
# integers, machine-specific floating point exceptions (infinity,
# not-a-number ...), of the effects of locale, and of features
-# specific to multi-byte characters (under use utf8 and such).
+# specific to multi-byte characters (under the utf8 pragma and such).
BEGIN {
chdir 't' if -d 't';
diff --git a/t/op/tr.t b/t/op/tr.t
index 1e30365eeb..6390f6a9e5 100755
--- a/t/op/tr.t
+++ b/t/op/tr.t
@@ -80,9 +80,6 @@ else {
print "ok 10\n";
{
-if (ord("\t") == 9) { # ASCII
- use utf8;
-}
# 11 - changing UTF8 characters in a UTF8 string, same length.
my $l = chr(300); my $r = chr(400);
$x = 200.300.400;