use strict; use warnings; $| = (@ARGV > 0); print "this is partial line...."; sleep (20); print "the rest of the story\n"; #### use strict; use warnings; open FILE, '>', 'test' or die; select FILE; #this is important for $| the hard disk file! $| = (@ARGV > 0); print STDERR "partial line going to disk"; print FILE "this is partial line...."; sleep (20); print FILE "the rest of the story\n"; print STDERR "line is complete\n"; print STDERR "starting another sleep\n"; sleep(20); print STDERR "program ended\n";