vsespb has asked for the wisdom of the Perl Monks concerning the following question:

This documentation says it's not:

http://www.plover.com/FAQs/Buffering.html

There's one other exception to the rule that says that filehandles are cold unless they're attached to the terminal: The filehandle STDERR, which is normally used for error logging, is always in line buffered mode by default.

But there are example code in perldoc, which make me think it's sometimes buffered

http://perldoc.perl.org/functions/select.html

use IO::Handle; STDERR->autoflush(1);

Also this blogpost claims that it does

http://blog.famzah.net/2010/04/08/auto-flush-both-stdout-and-stderr-in-perl/

In my tests it's always line buffered, even when not attached to terminal, but I wonder if this is always true or not.

Also I have an error in one of my scripts, which might be related to this (process terminated with signal and STDERR output truncated, even if contains newlines), but I can't reproduce it so can't investigate

Replies are listed 'Best First'.
Re: Is STDERR buffered?
by Anonymous Monk on May 24, 2013 at 14:56 UTC

      Ok, Thanks!

      Indeed, it can be line-buffered, block-buffered or unbuffered. So, perldoc example make sense.

      But blogpost above talks about block-buffering, I believe. Anyway I'll try check perl source. Thanks!