Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: How do you get the PID of an external process?

by syphilis (Canon)
on Sep 24, 2013 at 23:37 UTC ( #1055563=note: print w/ replies, xml ) Need Help??


in reply to How do you get the PID of an external process?

I can't use any modules that aren't standard

There's a standard module called Win32, and you might be able to make use of its GetCurrentProcessId() function.
Here's the documentation for that function:

Win32::GetCurrentProcessId() Returns the process identifier of the current process. Until the process terminates, the process identifier uniquely identifies the process throughout the system. The current process identifier is normally also available via the predefined $$ variable. Under fork() emulation however $$ may contain a pseudo-process identifier that is only meaningful to the Perl kill(), wait() and waitpid() functions. The Win32::GetCurrentProcessId() function will always return the regular Windows process id, even when called from inside a pseudo-process.
Cheers,
Rob


Comment on Re: How do you get the PID of an external process?
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1055563]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (9)
As of 2014-07-11 09:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (224 votes), past polls