$SIG{CHLD}=\&REAPER; sub REAPER{ my $stiff; while(($stiff = waitpid(-1,&WNOHANG))>0){ # do something with $stiff if you want } $SIG{CHLD}=\&REAPER; } #### $SIG{CHLD}=\&REAPER; sub REAPER{ $SIG{CHLD}='IGNORE'; my $stiff; while(($stiff = waitpid(-1,&WNOHANG))>0){ # do something with $stiff if you want } $SIG{CHLD}=\&REAPER; }