How to control timing of buffer flushing in Perl -
how exert more control on buffering in perl? know can use autoflush
flush buffer immediately, or can nothing , let perl flush when feels it.
but can change buffer size? or can force flush every, say, 30 seconds?
i'd know how either file handle or stdout. i've tried going through io::handle
documentation, haven't been able figure out need.
but can change buffer size?
before 5.14, size of every file handle's buffer 4096 bytes.
since 5.14, size of every file handle's buffer can chosen when perl built (by passing -accflags=-dperliobuf_default_bufsiz=num_bytes
configure
). default 8192 bytes.
or can force flush every, say, 30 seconds?
you can force flush whenever want to.
use io::handle qw( ); # not needed in 5.14+ $fh->flush(); stdout->flush();
Comments
Post a Comment