Help for this page

Select Code to Download


  1. or download this
    my @pids;
    for loop {
    ...
    # only parent reaches this point
    
    kill 9, @pids; # perform mass filicide
    
  2. or download this
    use POSIX qw(:syswait_h);
    
    while ((my $pid = waitpid(-1, WNOHANG)) != -1) {
      kill 9, $pid;
    }