in reply to Flush all opened STDIO streams

Try
use IO::Handle; STDERR->flush;

Replies are listed 'Best First'.
Re^2: Flush all opened STDIO streams
by dmitnin (Initiate) on Feb 03, 2014 at 14:10 UTC
    Sorry, but it did not work. Also, I tried:
    STDERR->autoflush(1)
    Another thing, that works is to recompile XS with fflush after logging:
    fprintf(stderr, "..."); fflush(stderr);
    but I can't install/update XS package on the production servers. May be anyone knows some perl module, that can do fflush(NULL)?

      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; } }

      Maybe you can fake it

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