Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: Flushing the print buffers.

by almut (Canon)
on Feb 22, 2008 at 00:22 UTC ( #669432=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Flushing the print buffers.
in thread Flushing the print buffers.

Good question.  With older Perls (pre-5.8) you could do

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...)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://669432]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2016-07-29 12:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?


















    Results (261 votes). Check out past polls.