in reply to Re: Screen Output Buffering
in thread Screen Output Buffering

mortis,
To make sure STDOUT is autoflushed, set $| to a true value early in your program

I am sorry about nitpicking but setting $| to a true value will turn on auto-flushing for the currently selected file handle. I know it is being pedantic, but just because STDOUT is the default selected file handle doesn't mean it has to be:

#!/usr/bin/perl use strict; use warnings; open (FILE, '>', 'foo.txt') or die "Unable to open foo.txt for writing + : $!"; select FILE; $| = 1; # FILE is now unbuffered print "hello, world\n"; print STDOUT "goodbye cruel world\n"; # still buffered

Cheers - L~R