my $child;
my $can_fork;
+my $has_perlio;
BEGIN {
chdir 't' if -d 't';
exit 1;
}
}
+ unless ($has_perlio = find PerlIO::Layer 'perlio') {
+ print <<EOF;
+# Since you don't have perlio you might get failures with UTF-8 locales.
+EOF
+ }
}
use Socket;
"socketpair (LEFT, RIGHT, AF_UNIX, SOCK_STREAM, PF_UNSPEC)")
or print "# \$\! = $!\n";
-binmode(LEFT, ":bytes");
-binmode(RIGHT, ":bytes");
+if ($has_perlio) {
+ binmode(LEFT, ":bytes");
+ binmode(RIGHT, ":bytes");
+}
my @left = ("hello ", "world\n");
my @right = ("perl ", "rules!"); # Not like I'm trying to bias any survey here.
"socketpair (LEFT, RIGHT, AF_UNIX, SOCK_DGRAM, PF_UNSPEC)")
or print "# \$\! = $!\n";
-binmode(LEFT, ":bytes");
-binmode(RIGHT, ":bytes");
+if ($has_perlio) {
+ binmode(LEFT, ":bytes");
+ binmode(RIGHT, ":bytes");
+}
foreach (@left) {
# is (syswrite (LEFT, $_), length $_, "write " . _qq ($_) . " to left");
#!./perl
+my $has_perlio;
+
BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
require './test.pl';
+ unless ($has_perlio = find PerlIO::Layer 'perlio') {
+ print <<EOF;
+# Since you don't have perlio you might get failures with UTF-8 locales.
+EOF
+ }
}
# NOTE!
foreach (@tests) {
my ($why, $prog, $expect) = @$_;
open P, ">$progfile" or die "Can't open '$progfile': $!";
- binmode(P, ":bytes");
+ binmode(P, ":bytes") if $has_perlio;
print P $show, $prog, '; print $b'
or die "Print to 'progfile' failed: $!";
close P or die "Can't close '$progfile': $!";