title: fork + exec + caller should not wait for child
body: <p>I have two scripts script_a and script_b.
  script_a calls script_b. script_b forks two processes. As shown below.</p>
  
  <p>script_a waits for both the parent and child of script_b to finish.
  I want script_a to continue without waiting for the child process of script_b.</p>
  
  <p>What I have done for this is in script_b, I have added the following code.</p>
  
  <pre><code>if (! $f_id) {
      close STDOUT;
      close STDERR;
      exec("sleep 10; echo 'i am child'");
  }
  </code></pre>
  
  <p>This works for me. script_a no longer waits for the child process.</p>
  
  <p>My question here is,
  1. Is this the right way to do this?
  2. Do parent and the child process share the same STDOUT and STDERR and would I end up in trouble if there is a race condition?
  3. Are there better ways to do this?</p>
  
  <p>Thanks in advance for the help.</p>
  
  <p>script_a.pl</p>
  
  <pre><code>#! /usr/local/bin/perl
  print `script_b.pl`;
  </code></pre>
  
  <p>script_b.pl</p>
  
  <pre><code>#! /usr/local/bin/perl
  
  $f_id = fork();
  
  if (! $f_id) {
      exec("sleep 10; echo 'i am child'");
  }
  
  if ($f_id) {
      print "i am parent\n";
  }
  </code></pre>