Morbus Iff wrote:
Turns buffering off the the currently selected filehandle (usually
STDOUT).  Good for seeing things in the proper sequence, but can
slow processing down if you write to that FH a lot.


Some slight anal clarity - it doesn't turn buffering off,
it just forces the buffer to be flushed immediately.

Some more anal clarity. It does force the buffer to be flushed immediately, but its true purpose is to switch from block buffering to line buffering. This, I believe, is simply a call to the setbuf command to change buffering style. And yes, it does turn {block} buffering off - causing line to be output immediately instead of buffered.

Man page text:

    autoflush HANDLE EXPR
    $OUTPUT_AUTOFLUSH
    $|      If set to nonzero, forces a flush right away and after every write
            or print on the currently selected output channel. Default is 0
            (regardless of whether the channel is really buffered by the system
            or not; "$|" tells you only whether you've asked Perl explicitly to
            flush after each write). STDOUT will typically be line buffered if
            output is to the terminal and block buffered otherwise. Setting this
            variable is useful primarily when you are outputting to a pipe or
            socket, such as when you are running a Perl program under rsh and
            want to see the output as it's happening. This has no effect on
            input buffering. See the getc entry in the perlfunc manpage for
            that. (Mnemonic: when you want your pipes to be piping hot.)

Windoze implements setbuf like this:

"The setbuf function controls buffering for stream. The stream argument must
refer to an open file that has not been read or written. If the buffer
argument is NULL, the stream is unbuffered. If not, the buffer must point
to a character array of length BUFSIZ, where BUFSIZ is the buffer size as
defined in STDIO.H. The user-specified buffer, instead of the default
system-allocated buffer for the given stream, is used for I/O buffering.
The stderr stream is unbuffered by default, but you can use setbuf to assign
buffers to stderr."

--
  ,-/-  __      _  _         $Bill Luebkert   ICQ=162126130
 (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/


_______________________________________________ Perl-Win32-Admin mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to