in reply to Flush all opened STDIO streams
use IO::Handle; STDERR->flush; [download]
STDERR->autoflush(1) [download]
fprintf(stderr, "..."); fflush(stderr); [download]
What is the fileno of that c/xs stderr versus perl's STDERR?
Maybe you can fake it
sub flushall { for my $fileno (0..1024){ ## blah blah constants open my($fake), "<&=$fileno"; ## UGLY $fake->flush; } } [download]
sub flushall { use POSIX(); for my $fileno (0.. POSIX::dup( fileno( STDERR) ) ){ open my($fake), ">&=$fileno"; ## UGLY $fake->flush; } } [download]