On Fri, 28 Jun 2013 11:57:24 +0100
Rob Dixon <rob.di...@gmx.com> wrote:

> On 28/06/2013 02:32, Uri Guttman wrote:
> >
> > you don't need
> > ever to set $| on stderr as it is not buffered like stdout is. and
> > you rarely need to set it on stdout as any print with a \n will
> > flush stdout.
> 
> That isn't true.
> 
> Perl will buffer STDOUT up to 8KB regardless of whether a newline has
> been printed, unless `autoflush` has been enabled when it will flush
> after every print `statement`.
> 
> Rob
> 
> 

I don't think that's correct. If connected to a terminal, both STDOUT
and STDERR will buffer until a newline and then flush. If connected to
anything else, then they will use the full buffer.

One should not be worried about setting autoflush since in most cases,
Perl will do the correct thing. It's only when you are manipulating the
terminal's cursor directly would you need to set it.


-- 
Don't stop where the ink does.
        Shawn

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to