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.
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.