Skip to content
Alex Sergeyev edited this page May 30, 2014 · 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;
STDOUT->autoflush(1);

And there is also (not recommended) ancient way of doing it:

$|++;
Clone this wiki locally