p4raw-id: //depot/perl@20058
print "1..3\n";
use Digest::MD5 ();
+use Config;
$md5 = Digest::MD5->new;
eval {
$md5->addfile(*BAR);
};
-print "not " unless $@ =~ /^Reading from filehandle failed at/;
+# Some stdio implementations don't find reading from
+# write-only filehandle to be a problem. Therefore we
+# cannot expect this to fail reliably with stdio.
+my $stdio = !exists $Config{useperlio} ||
+ !defined $Config{useperlio} ||
+ (exists $ENV{PERLIO} && $ENV{PERLIO} eq 'stdio');
+print "not " unless $@ =~ /^Reading from filehandle failed at/ || $stdio;
print "ok 3\n";
close(BAR);