use IO::Handle qw( ); $fh->autoflush(1); # Don't buffer. print $fh "foo"; $fh->autoflush(0); # Use buffer. print $fh "foo"; # Only sent when buffer is full or flushed. $fh->flush(); # Send what's in buffer (if anything) now.