perl -E' open my $fh, ">&", *STDOUT 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 0 0