To set the autoflush, just set the magic variable $| to 1.
I used $|++ to increment it, because it's default value is 0, or autoflush turned off.
Autoflush means that Perl sends the output of print's in time they are called. When it's off, Perl puts the print's output in a temporary buffer, and sends the print's output in blocks to the screen/client/etc.
.
Just another not-perfect-but-trying-to-be-legible answer 8-) | [reply] |
Well you can use standard IO modules to do it in an OO fashion but the simplest (and most common in old scripts I would argue) is
$|++;
This increments the $| variable. To learn more take a look at the perlvar man page. | [reply] [d/l] |