> > Question: What is "flush"? and how can a filehandle be flushed? I saw
> > such a phrase while looking for info about file locking.
>
> If you would rather have every byte sent down that pipeline without
> buffering, you can set a filehandle as unbuffered with the following:
>
> my prev = select FH; # stores the previous default filehandle,
> # and set FH as the new default
> $| = 1; # any true for $| unbuffers the current default filehandle
> select $prev; # restores the previous default
>
> Now that filehandle won't buffer.
> Also, look at perldoc FileHandle for a filenadle class (which has
> several benefits, including a more readable and concise
> $fh->autoflush(1) syntax).
I'm sorry, I might sound lame, but these buffering and autoflush problems seem a
bit(?) theoretical and far-fetched to me. Would you please show me examples of
situations (or links to codes) where the use of autoflush instead of buffering IO (or
vice versa) would be crucial.
thank you,
kosta