title: How can I make Perl wait for child processes started in the background with system()?
body: <p>I have some Perl code that executes a shell script for multiple parameters, to simplify, I'll just assume that I have code that looks like this:</p>
  
  <pre><code>for $p (@a){
      system("/path/to/file.sh $p&amp;");
  }
  </code></pre>
  
  <p>I'd like to do some more things after that, but I can't find a way to wait for all the child processes to finish before continuing. </p>
  
  <p>Converting the code to use fork() would be difficult. Isn't there an easier way?</p>