Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

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

by syphilis (Chancellor)
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.

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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2015-10-10 07:26 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (255 votes), past polls