open my $output, '>-' or die $!; close *STDOUT; print {$output} "This fails with Bad file descriptor";