in reply to Using perl to manage child processes - critique my code.

Also within CPAN are “work queue” packages, which really are a much-better description of what you are really trying to do here.

The bottom line is:   you've got about 140 units-of-work to do, and although you (of course) want to get them done “as soon as possible,” the ruling constraint is that you need to limit the number of units that are being attempted at any one time. Hence, you could reasonably express this objective as:   “up to n workers, burning their way through a queue with 140 entries on it.”

So... model it that way.

Have a pool of n processes or threads, each one of which “retrieves a unit-of-work from the queue, and then performs it.” They continue doing this until they find that the queue is empty; then they terminate. Because the number of processes/threads is limited (and adjustable...), you've got “knob” you're looking for.

If you wanted to get more-elaborate about it, then of-course you could do so... defining several queues and placing “short” tasks in one and “long” tasks in another, for example, and dedicating a certain number of threads to each queue. The possibilities are endless, and (the bottom line is...) no matter how you choose to do it, predictable and controllable.