title: Kill child process created with fork
body: <p>The following will output :</p>
  
  <pre><code>Start of script
  PID=29688
  Start of script
  PID=0
  Running child process 1
  Done with child process
  PID=29689
  Start of script
  PID=0
  Running child process 1
  Done with child process
  </code></pre>
  
  <p>It's working as intended, however I would like to kill the previous child PID.</p>
  
  <p>How can a kill the PID of the child with out kiling the MAIN ?</p>
  
  <p>Thank you !</p>
  
  <pre><code>my $bla = 1;
  
  while (1) {
  
  print "Start of script\n";
  run_sleep();
  
  }
  
  sub run_sleep {
  
      sleep(3);
      my $pid = fork;
  
      return if $pid;     # in the parent process
      print("PID=" . $pid . "\n");
      print "Running child process " . $bla++ . "\n";
      exit(0);  # end child process
  
  }
  </code></pre>