http://www.perlmonks.org?node_id=1052796


in reply to Re^5: Get the process id, and output of a process, in a threaded environment
in thread Get the process id, and output of a process, in a threaded environment

Darn, I was hoping you would have better news!

The only solution that I could come up with was basically your first solution, and would basically write a perl script and open that with a pipe. This script would do the required SETS, open the process that we can now get the actual pid from, and print the pid as the first line, something along the lines of PID=<pid>, which is just what you described.

Far from an elegant solution, but it was the only one I saw.

As for your second solution, I'm with you not having idea of if its possible, and something tells me getting it to work on all *nix environments AND windows, would be a nightmare.

As always, thanks for taking a look!

  • Comment on Re^6: Get the process id, and output of a process, in a threaded environment