Commit | Line | Data |
---|---|---|
35cd451c GS |
1 | #!./perl |
2 | ||
d80ecdf8 | 3 | BEGIN { |
a817e89d | 4 | chdir 't' if -d 't'; |
d80ecdf8 | 5 | require './test.pl'; |
624c42e2 | 6 | set_up_inc('../lib'); |
d80ecdf8 | 7 | } |
35cd451c | 8 | |
d80ecdf8 | 9 | plan tests => 8; |
35cd451c GS |
10 | |
11 | # symbolic filehandles should only result in glob entries with FH constructors | |
12 | ||
648cac19 | 13 | $|=1; |
35cd451c | 14 | my $a = "SYM000"; |
66745c0b BE |
15 | ok(!defined(fileno($a)), 'initial file handle is undefined'); |
16 | ok(!defined *{$a}, 'initial typeglob of file handle is undefined'); | |
35cd451c GS |
17 | |
18 | select select $a; | |
66745c0b | 19 | ok(defined *{$a}, 'typeglob of file handle defined after select'); |
35cd451c | 20 | |
f83494b9 | 21 | $a++; |
66745c0b BE |
22 | ok(!close $a, 'close does not succeed with incremented file handle'); |
23 | ok(!defined *{$a}, 'typeglob of file handle not defined after increment'); | |
35cd451c | 24 | |
66745c0b BE |
25 | ok(open($a, ">&STDOUT"), 'file handle used with open of standard output'); |
26 | ok(defined *{$a}, 'typeglob of file handle defined after opening standard output'); | |
d80ecdf8 | 27 | |
66745c0b | 28 | ok(close $a, 'close standard output via file handle;'); |
35cd451c | 29 |