in reply to Re^3: Fork() Function
in thread Fork() Function

I like your response a lot, because it makes perfect sense. So, in my case, I want to execute a separate script in the child process (which is the system call in the code posted). My while loop continuously grabs commands from a mysql database. In the event that a stop command is encountered, my loop will kill the child process, stopping the script that was started with a 'start' command. I agree you that a system command may be unnecessary in this case. But, with an exec call, I don't think it returns a child ID, so how would I keep track of the script and end it when the command comes in?

General Question: When I call system, there is an implicit wait call until the child finishes?

An Approach: I think someone mentioned that an array would be useful, to keep track of the child pid's. I am trying that route, because it may work in my case. Thoughts?

Replies are listed 'Best First'.
Re^5: Fork() Function
by morgon (Priest) on May 14, 2014 at 15:27 UTC
    General Question: When I call system, there is an implicit wait call until the child finishes?
    Yes. See "perldoc -f system"