in reply to Re: sending multiple commandsin thread sending multiple commands
Parallel::ForkManager (which you originally suggested) provides a simple way to specify the maximum number of parallel processes — no need to reinvent the wheel.