use IO::Handle '_IOFBF';
my $buf;
# set fully buffered, with a buffer size of 1024 bytes
STDOUT->setvbuf($buf, _IOFBF, 1024);
but these days, setvbuf/setbuf are no longer available
unless perl is compiled to explicitly not use perlio.
I'd like to know myself whether there is a substitute for
setvbuf (without writing your own XS), as on rare occasions there might be valid uses for
being able to control buffering mode or buffer size with Perl. (The
function doesn't seem to be POSIX, so use POSIX; wouldn't
help, AFAIK...)
|