BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
-}
+}
-# $RCSfile$
+# $RCSfile$
$| = 1;
use warnings;
$Is_VMS = $^O eq 'VMS';
# 1..9
{
- unlink("afile") if -f "afile";
+ unlink("afile") if -f "afile";
print "$!\nnot " unless open(my $f,"+>afile");
ok;
binmode $f;
- print "not " unless -f "afile";
+ print "not " unless -f "afile";
ok;
print "not " unless print $f "SomeData\n";
ok;
$b = <$f>;
print "not " unless $b eq "SomeData\n";
ok;
- print "not " unless -f $f;
+ print "not " unless -f $f;
ok;
- eval { die "Message" };
+ eval { die "Message" };
# warn $@;
print "not " unless $@ =~ /<\$f> line 1/;
ok;
print "not " unless close($f);
ok;
- unlink("afile");
+ unlink("afile");
}
# 10..12
print "not " unless -s 'afile' > 20;
ok;
- unlink("afile");
+ unlink("afile");
}
# 24..26
1;
EOE
ok;
-$@ =~ /Unknown open\(\) mode \'<&\'/ or print "not ";
+$@ =~ /Bad filehandle:\s+afile/ or print "not ($@)";
ok;
# local $file tests
# 33..41
{
- unlink("afile") if -f "afile";
+ unlink("afile") if -f "afile";
print "$!\nnot " unless open(local $f,"+>afile");
ok;
binmode $f;
- print "not " unless -f "afile";
+ print "not " unless -f "afile";
ok;
print "not " unless print $f "SomeData\n";
ok;
$b = <$f>;
print "not " unless $b eq "SomeData\n";
ok;
- print "not " unless -f $f;
+ print "not " unless -f $f;
ok;
- eval { die "Message" };
+ eval { die "Message" };
# warn $@;
print "not " unless $@ =~ /<\$f> line 1/;
ok;
print "not " unless close($f);
ok;
- unlink("afile");
+ unlink("afile");
}
# 42..44
print "not " unless -s 'afile' > 20;
ok;
- unlink("afile");
+ unlink("afile");
}
# 56..58
1;
EOE
ok;
-$@ =~ /Unknown open\(\) mode \'<&\'/ or print "not ";
+$@ =~ /Bad filehandle:\s+afile/ or print "not ($@) ";
ok;
# 65..66