Help for this page

Select Code to Download


  1. or download this
    $term = 0;
    $SIG{TERM} = sub { $term = 1; };
    ...
      # check the child again after 1 second
      sleep(1);
    }
    
  2. or download this
    # waitpid($pid,WNOHANG) returns 0 if the child process
    # exists and has not terminated
    ...
      }
    
    }