perlquestion
Jim
<p>I want to use Perl 5.14 (ActiveState ActivePerl) to manage many thousands of executions of an external command-line utility under Microsoft Windows, each with a different argument. If I run them in sequence in a simple loop, they'll take too long to finish, so I want to run them in parallel as well as in an ordered sequence, <i>n</i> at a time (where the optimum value of <i>n</i> is probably going to be 20). I've never done this kind of job control before using Perl, so I need help getting started. Before now, I've used both tricks with the <code>start</code> command in funky systems of batch files and the nifty Unix <code>xargs</code> utility under both the MKS Toolkit and Cygwin. Now, for several important reasons, I need to use Perl instead.</p>
<p>So let's say I want to run a command-line utility named <code>doit.exe</code> 10,000 times on the arguments <code>toit0000</code>, <code>toit0001</code>, <code>toit0002</code>, …, <code>toit9999</code>. I want to invoke the jobs generally in that order, but I want to run them in parallel, 20 at a time. How do I do this in Perl? Assume I have a simple array of the ordered arguments; for example: <code>my @ordered_arguments = <DATA>; chomp @ordered_arguments;</code>.</p>
<p>Jim</p>