Help for this page

Select Code to Download


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