Kill a process in Perlby uzers (Initiate)
|on Jul 11, 2009 at 06:07 UTC||Need Help??|
uzers has asked for the
wisdom of the Perl Monks concerning the following question:
I am trying to kill an external process called out in Perl after certain seconds.
I am using Windows.
I want to call out "a.exe" in perl in a new thread (so that the main perl program can go on). Then I want to kill the "a.exe" after 30 seconds before a.exe naturally ends by itself which usually takes 10mins ?
I think I have to kill it by process ID of "a.exe" but not the process name, because I will run many a.exe at the same time, and I only want the perl to kill its own a.exe. But, I have no idea how to get process ID also...
Any idea to do the mentioned task?
Please kindly help me. Thanks in advance!