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
In reply to Re^2: Screen Output Buffering
by Limbic~Region
in thread Screen Output Buffering
by mvaline
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |