title: Perl fork process using open3
body: <p>I have a perl script in which I am forking a child process. Here is what I am doing:</p>
  
  <pre><code>my $pid = fork;
  
  if($pid) {
  # parent 
  waitpid($pid, 0);
  }
  else {
  exec("some other script X.pl");
  }
  </code></pre>
  
  <p>Now, I wanted to capture the error of X.pl to display in my script. But as I understand this is not possible suing exec. </p>
  
  <p>What are the other options I have?</p>
  
  <p>How can I use open3 in my case?</p>
  
  <p>Thanks!</p>