in reply to sending multiple commands

One further thought:   if you have a lot of these commands to issue, set up a thread-safe FIFO queue (or pipe, as the case may be) that you push the commands into, and set up a limited number of worker threads/processes that pop work-requests off of that queue.   The queue provides the necessary “flexible hose” that keeps the system from over-committing itself if a sudden flood of requests appears.

Simple shell-scripts sometimes do not take this into consideration, and the not-so affectionate name for what happens (sometimes used as a denial-of-service attack) is a “fork bomb.”

Replies are listed 'Best First'.
Re^2: sending multiple commands
by Anonyrnous Monk (Hermit) on Jan 08, 2011 at 17:52 UTC

    Parallel::ForkManager (which you originally suggested) provides a simple way to specify the maximum number of parallel processes — no need to reinvent the wheel.