Help for this page
... my $pid = wait; ... $pid1 = -1; # indicate child1 has been reaped } ...
while (1) { my $pid = wait; ... if ($pid == $pid1) { ... } elsif ($pid == $pid2) { ... } }