6 $Is_VMS = $^O eq 'VMS';
13 unlink("afile") if -f "afile";
14 print "$!\nnot " unless open(my $f,"+>afile");
17 print "not " unless -f "afile";
19 print "not " unless print $f "SomeData\n";
21 print "not " unless tell($f) == 9;
23 print "not " unless seek($f,0,0);
26 print "not " unless $b eq "SomeData\n";
28 print "not " unless -f $f;
30 eval { die "Message" };
32 print "not " unless $@ =~ /<\$f> line 1/;
34 print "not " unless close($f);
39 print "# \$!='$!'\nnot " unless open(my $f,'>', 'afile');
42 print "not " unless close($f);
44 print "not " unless -s 'afile' < 10;
48 print "# \$!='$!'\nnot " unless open(my $f,'>>', 'afile');
51 print "not " unless close($f);
53 print "not " unless -s 'afile' > 10;
57 print "# \$!='$!'\nnot " unless open(my $f, '<', 'afile');
60 print "not " unless @rows == 2;
62 print "not " unless close($f);
66 print "not " unless -s 'afile' < 20;
68 print "# \$!='$!'\nnot " unless open(my $f, '+<', 'afile');
71 print "not " unless @rows == 2;
74 print $f "yet another row\n";
75 print "not " unless close($f);
77 print "not " unless -s 'afile' > 20;
82 if ($Is_VMS) { for (24..46) { print "ok $_ # skipped: not Unix fork\n"; {
84 print "# \$!='$!'\nnot " unless open(my $f, '-|', <<'EOC');
85 perl -e "print qq(a row\n); print qq(another row\n)"
89 print "not " unless @rows == 2;
91 print "not " unless close($f);
94 if ($Is_VMS) { for (27..30) { print "OK $_ # skipped: not Unix fork\n"; }
96 print "# \$!='$!'\nnot " unless open(my $f, '|-', <<'EOC');
101 print $f "not ok 28\n";
102 print $f "not ok 29\n";
103 print "#\nnot " unless close($f);
108 eval <<'EOE' and print "not ";
109 open my $f, '<&', 'afile';
113 $@ =~ /Unknown open\(\) mode \'<&\'/ or print "not ";