Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1055563]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2018-06-20 06:11 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (116 votes). Check out past polls.