Update: Thanks to dws (++!), I stand corrected.
I'm not convinced that you'll be able to get the PID of the command which is being exec()'d.
Sure, fork() returns it's PID to the parent, but that's still only given you the PID of the perl process that is going to be doing the exec("command"), not the PID of command itself.
I've had a quick look at IPC::Open3 - it returns the PID of the child process, but I'm not sure if it's the fork()'ed perl process, or the external command.
Unfortunately I've not got time to look in that further right now - it is left as an exercise for the reader :-)
Cheers,
BazB
|