12 unlink("afile") if -f "afile";
13 print "$!\nnot " unless open(my $f,"+>afile");
16 print "not " unless -f "afile";
18 print "not " unless print $f "SomeData\n";
20 print "not " unless tell($f) == 9;
22 print "not " unless seek($f,0,0);
25 print "not " unless $b eq "SomeData\n";
27 print "not " unless -f $f;
29 eval { die "Message" };
31 print "not " unless $@ =~ /<\$f> line 1/;
33 print "not " unless close($f);
38 print "# \$!='$!'\nnot " unless open(my $f,'>', 'afile');
41 print "not " unless close($f);
43 print "not " unless -s 'afile' < 10;
47 print "# \$!='$!'\nnot " unless open(my $f,'>>', 'afile');
50 print "not " unless close($f);
52 print "not " unless -s 'afile' > 10;
56 print "# \$!='$!'\nnot " unless open(my $f, '<', 'afile');
59 print "not " unless @rows == 2;
61 print "not " unless close($f);
65 print "not " unless -s 'afile' < 20;
67 print "# \$!='$!'\nnot " unless open(my $f, '+<', 'afile');
70 print "not " unless @rows == 2;
73 print $f "yet another row\n";
74 print "not " unless close($f);
76 print "not " unless -s 'afile' > 20;
82 print "# \$!='$!'\nnot " unless open(my $f, '-|', <<'EOC');
83 perl -e "print qq(a row\n); print qq(another row\n)"
87 print "not " unless @rows == 2;
89 print "not " unless close($f);
93 print "# \$!='$!'\nnot " unless open(my $f, '|-', <<'EOC');
98 print $f "not ok 28\n";
99 print $f "not ok 29\n";
100 print "#\nnot " unless close($f);
105 eval <<'EOE' and print "not ";
106 open my $f, '<&', 'afile';
110 $@ =~ /Unknown open\(\) mode \'<&\'/ or print "not ";