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