$ perl -E'open my $foo, "<&=1"; say $foo->fileno; say $foo == \*STDOUT ? "STDOUT" : "Not STDOUT"' 1 Not STDOUT