$ perl -E' local *STDOUT; open STDOUT, ">&", 1 or die; open my $fh, ">&=", 1 or die; say $fh "test"; say $fh == STDOUT || 0; say $fh eq STDOUT || 0; say $fh == *STDOUT || 0; say $fh eq *STDOUT || 0; say fileno($fh) == 1 || 0; say fileno($fh) == fileno(STDOUT) || 0; ' test 0 0 0 0 1 0