print $mystdout "ok ",fileno($mystdout),"\n";
-$fh = new FileHandle "TEST", O_RDONLY and print "ok 2\n";
+$fh = (new FileHandle "./TEST", O_RDONLY
+ or new FileHandle "TEST", O_RDONLY)
+ and print "ok 2\n";
$buffer = <$fh>;
($rd,$wr) = FileHandle::pipe;
-if (fork) {
- $wr->close;
- print $rd->getline;
+if ($^O eq 'VMS' || $^O eq 'os2' || $^O eq 'amigaos') {
+ $wr->autoflush;
+ $wr->printf("ok %d\n",11);
+ print $rd->getline;
}
else {
- $rd->close;
- $wr->printf("ok %d\n",11);
- exit(0);
+ if (fork) {
+ $wr->close;
+ print $rd->getline;
+ }
+ else {
+ $rd->close;
+ $wr->printf("ok %d\n",11);
+ exit(0);
+ }
}