in reply to spawn process

Why do you need the pid if all you are going to do is wait until it finishes?

system 'yourcommand'; ##now it is finished.

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: spawn process
by brian42miller (Sexton) on Jul 08, 2011 at 20:09 UTC
    I need to spawn multiple processes and have them running in the background while the main program is doing other things and just monitoring for completion of the other processes. Brian

      If you are on Windows then you can do:

      my $pid = system 1, 'yourCommand';

      On other platforms you'll need to fiddle around with fork & exec.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.