# replaces print ; vec( my $rin, fileno(*CMD), 1) = 1; while (select my $rd = $rin, undef, undef, undef;) { my $bytes = sysread *CMD, my $buf, 4096; print $buf if 0 < $bytes; last if 1 > $bytes; } # wait added to lay the zombies sub myhand() { print "Parent $$ caught SIGINT.\n"; print "Parent $$ will KILL $pid.\n"; kill INT, $pid; waitpid $pid; exit 0; }