use IO::Handle; # update: not needed for Perl 5.14+ # ... $fh->autoflush();