VMS updates.
[p5sagit/p5-mst-13.2.git] / t / lib / filehand.t
1 #!./perl
2
3 BEGIN {
4     chdir 't' if -d 't';
5     @INC = '../lib';
6     require Config; import Config;
7     if ($Config{'extensions'} !~ /\bFileHandle\b/
8         && $Config{'osname'} ne 'VMS') {
9         print "1..0\n";
10         exit 0;
11     }
12 }
13
14 use FileHandle;
15 use strict subs;
16
17 $mystdout = new_from_fd FileHandle 1,"w";
18 autoflush STDOUT;
19 autoflush $mystdout;
20 print "1..4\n";
21
22 print $mystdout "ok ",fileno($mystdout),"\n";
23
24 $fh = new FileHandle "TEST", O_RDONLY and print "ok 2\n";
25 $buffer = <$fh>;
26 print $buffer eq "#!./perl\n" ? "ok 3\n" : "not ok 3\n";
27
28 ungetc STDIN 65;
29 CORE::read(STDIN, $buf,1);
30 print $buf eq 'A' ? "ok 4\n" : "not ok 4\n";