in reply to Getting PID's

I think you can't, directly. You could have your process write out it's pid to a file, and read it from your perl script - but since execution won't resume on the perl script anyway, until the process has ended, it's PID will be meaningless.

It's possible that you can do something with fork and exec:

perl -le ' if ($pid=fork) { print "pid: $pid"; exit; } exec ("echo new pid: \$\$"); '

-- Dan