CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Win32 Programming Help:
Kill a process in Perl



Jul 10, 2009, 6:18 PM

Post #1 of 2 (7982 views)
Kill a process in Perl Can't Post

Hi Gurus!

I am trying to kill an external process called out in Perl after certain seconds.

I am using Windows.

For example, I called out "a.exe" in perl by

my $result = `a.exe`;

What should I do to kill the "a.exe" after 30 seconds before a.exe naturally ends by itself which usually take 10mins ?

I must kill it by it's process ID but not the process name, because it is supposed I will run many a.exe at the same time, and I only want the perl to kill its own a.exe.

I think I need to use "sleep()" and "fork()", but still have no clear idea how to write the whole code after searching over the internet, perhaps my level is too low understand them.

I would be very much appreciated if you can write some sample code. Thank you very much!



Jul 11, 2009, 3:19 AM

Post #2 of 2 (7977 views)
Re: [uzers] Kill a process in Perl [In reply to] Can't Post

Thanks PerlMonks! My problem was solved. Any one interested please see!


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives