[Info-vax] How to retrieve the process PID from a perl script running on VMS

Craig A. Berry craigberry at nospam.mac.com
Fri Jan 13 18:56:08 EST 2012


Same as on any other OS -- use the $$ variable:

$ perl -e "print $$;"
142618

or if you need it in hex to be passed to various native utilities:

$ perl -e "printf STDOUT '%x', $$;"
22d1a

samizahra wrote:
> also how to replace this linux line in VMS
> 
> my($pid) = fork();

Read the docs at:

<http://perldoc.perl.org/perlvms.html#fork>

Basically you need to use some more portable IPC method.



More information about the Info-vax mailing list