open my $fh, ... use IO::Handle; $fh->autoflush(); # <--