sub flushall { use POSIX(); for my $fileno (0.. POSIX::dup( fileno( STDERR) ) ){ open my($fake), ">&=$fileno"; ## UGLY $fake->flush; } }