$| = 1;
-print "1..73\n";
+print "1..76\n";
use charnames ':full';
}
sub to_bytes {
- pack"a*", shift;
+ unpack"U0a*", shift;
}
{
1 while unlink $alifile;
}
+# [perl #30409] charnames.pm clobbers default variable
+$_ = 'foobar';
+eval "use charnames ':full';";
+print "not " unless $_ eq 'foobar';
+print "ok 74\n";
+
+# Unicode slowdown noted by Phil Pennock, traced to a bug fix in index
+# SADAHIRO Tomoyuki's suggestion is to ensure that the UTF-8ness of both
+# arguments are indentical before calling index.
+# To do this can take advantage of the fact that unicore/Name.pl is 7 bit
+# (or at least should be). So assert that that it's true here.
+
+my $names = do "unicore/Name.pl";
+print defined $names ? "ok 75\n" : "not ok 75\n";
+if (ord('A') == 65) { # as on ASCII or UTF-8 machines
+ my $non_ascii = $names =~ tr/\0-\177//c;
+ print $non_ascii ? "not ok 76 # $non_ascii\n" : "ok 76\n";
+} else {
+ print "ok 76\n";
+}
+
+
__END__
# unsupported pragma
use charnames ":scoobydoo";
use charnames ":short", ":alias" => { e_ACUTE => "LATIN:e WITH ACUTE", "a_ACUTE" };
"Here: \N{e_ACUTE}\N{a_ACUTE}!\n";
EXPECT
-Use of uninitialized value in string eq at
+Use of uninitialized value
########
# alias with hashref two aliases
use charnames ":short", ":alias" => {