# sub_program use strict; use warnings; { my $fh = select STDOUT; # making STDOUT "hot" (no IO buffering) $| = 1; select $fh; } for my $i (0..100) { print "$i \n"; sleep 3; }