in reply to Open pipe and fork or system command to retrieve PID and exit status - Best approach?
launch process, retrieve PID, and Exit StatusAt the same time? PID belongs to a running process; exit status is an int returned by terminating main(). Unless I've mistaken, you can't have both meaningful at the same time: when you have the exit status, the process is already terminated.
Anyway, have a look at IPC::Run. Other method is to pipe (thus you can read STDOUT), fork (thus you get the PID), exec then waitpid in the main procss (and then use $? to get the exit status).
Sorry if my advice was wrong.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Open pipe and fork or system command to retrieve PID and exit status - Best approach?
by Anonymous Monk on Aug 24, 2012 at 20:47 UTC |
In Section
Seekers of Perl Wisdom