|
Posted by Ben Morrow on March 7, 2008, 11:00 pm
Please log in for more thread options
>
> 5.1: How do I flush/unbuffer an output filehandle? Why must I do this?
>
>
> Perl does not support truly unbuffered output (except insofar as you can
> "syswrite(OUT, $char, 1)"), although it does support is "command
> buffering", in which a physical write is performed after every output
> command.
>
> The C standard I/O library (stdio) normally buffers characters sent to
> devices so that there isn't a system call for each byte. In most stdio
> implementations, the type of output buffering and the size of the buffer
> varies according to the type of device. Perl's "print()" and "write()"
> functions normally buffer output, while "syswrite()" bypasses buffering
> all together.
Is it worth mentioning
binmode $HANDLE, ':unix';
somewhere here, which will make all prints equivalent to syswrites?
Ben
|