1 # Digest::MD5 2.07 and older used to trigger a core dump when
2 # passed an illegal file handle that failed to open.
9 $md5 = Digest::MD5->new;
15 print "not " unless $@ =~ /^Bad filehandle: FOO at/;
18 open(BAR, "no-existing-file.$$");
22 print "not " unless $@ =~ /^No filehandle passed at/;
25 open(BAR, ">no-existing-file.$$") || die;
29 # Some stdio implementations don't find reading from
30 # write-only filehandle to be a problem. Therefore we
31 # cannot expect this to fail reliably with stdio.
32 my $stdio = !exists $Config{useperlio} ||
33 !defined $Config{useperlio} ||
34 (exists $ENV{PERLIO} && $ENV{PERLIO} eq 'stdio') ||
35 defined $Config{usefaststdio};
36 print "not " unless $@ =~ /^Reading from filehandle failed at/ || $stdio;
40 unlink("no-existing-file.$$");