Perl output buffering on files

To turn off output buffering in Perl you just do:

$| = 1;

To do it on an open filehandle (so the file gets written right away) you have to do:

open(LOG,">>$log");
LOG->autoflush(1);
Leave A Reply
All content licensed under the Creative Commons License