#!/usr/bin/perl use FileHandle; foreach my $line ( ) { my $ofh = select STDOUT; $| = 1; select $ofh; $ofh->autoflush(1); print STDOUT $line; }