Skip to content
joewalnes edited this page Feb 21, 2013 · 3 revisions

Sending messages immediately

By default, Perl will buffer any output sent to STDOUT and STDERR. If your program writes a message, it may not get sent immediately.

To handle this, you can enable auto-flushing at the beginning of your program:

use IO::Handle;
STDERR->autoflush(1);
STDOUT->autoflush(1);
Clone this wiki locally