use IPC::Open2; use POSIX ":sys_wait_h"; my $pid = open2 ( REA, WRI, 'tr a-z A-Z' ) or die $!; for (){ print {\*WRI} [(my $cmd, my @rest) = split]->[0]; } close WRI; print ; close REA; # but believe it or not, under sysV the zombie is still there! waitpid($pid,0); # this will finally kill it cleanly! __END__ # although exit from the program will eventually kill it of course an apple a day boat for bloat