BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
- unless (exists $open::layers{'perlio'}) {
+ unless (find PerlIO::Layer 'perlio') {
print "1..0 # Skip: not perlio\n";
exit 0;
}
}
+no utf8; # so that the naked 8-bit chars won't gripe under use utf8
+
$| = 1;
my $total_tests = 25;
if (ord('A') == 193) { $total_tests = 24; } # EBCDIC platforms do not warn on UTF-8
# Now let's make it suffer.
open F, ">", "a" or die $!;
-eval { print F $a; };
-print "not " unless $@ and $@ =~ /Wide character in print/i;
+my $w;
+eval {local $SIG{__WARN__} = sub { $w = $_[0] }; print F $a; };
+print "not " if ($@ || $w !~ /Wide character in print/i);
print "ok 22\n";
}