This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Skip no-common-vars optimisation for aliases
[perl5.git] / t / op / fh.t
CommitLineData
35cd451c
GS
1#!./perl
2
d80ecdf8
RGS
3BEGIN {
4 chdir 't';
5 @INC = '../lib';
6 require './test.pl';
7}
35cd451c 8
d80ecdf8 9plan tests => 8;
35cd451c
GS
10
11# symbolic filehandles should only result in glob entries with FH constructors
12
648cac19 13$|=1;
35cd451c 14my $a = "SYM000";
66745c0b
BE
15ok(!defined(fileno($a)), 'initial file handle is undefined');
16ok(!defined *{$a}, 'initial typeglob of file handle is undefined');
35cd451c
GS
17
18select select $a;
66745c0b 19ok(defined *{$a}, 'typeglob of file handle defined after select');
35cd451c 20
f83494b9 21$a++;
66745c0b
BE
22ok(!close $a, 'close does not succeed with incremented file handle');
23ok(!defined *{$a}, 'typeglob of file handle not defined after increment');
35cd451c 24
66745c0b
BE
25ok(open($a, ">&STDOUT"), 'file handle used with open of standard output');
26ok(defined *{$a}, 'typeglob of file handle defined after opening standard output');
d80ecdf8 27
66745c0b 28ok(close $a, 'close standard output via file handle;');
35cd451c 29