3 # This file is for testing select() with one argument. Four-argument
4 # select() is tested in sselect.t.
14 open my $fh, "test.pl" or die "$0 unfortunately cannot open test.pl: $!";
16 is select, 'main::STDOUT', 'select retval';
17 is select($fh), 'main::STDOUT', 'select retval when called with argument';
18 ok ref select, 'select returns ref for glob generated by open';
19 is select, $fh, 'the ref returned references the right referent';
20 is select(STDOUT), $fh, 'select previous ref when setting to bareword';
21 is select, 'main::STDOUT', 'switching back to STDOUT';
22 is ref\select, 'SCALAR', 'and STDOUT is a plain string';
24 open foo::bar, "test.pl" or die "$0 sadly cannot open test.pl: $!";
30 'select returns ref for glob whose stash has been detached';
32 open thwat::snin, "test.pl" or die "$0 is unable to open test.pl: $!";
34 $handle = \*thwat::snin;
35 *thwat:: = *snin::; # gv is now *__ANON__::snin
37 'select returns ref for glob with no stash pointer';