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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

 



uzers
Novice

Jul 10, 2009, 6:18 PM

Post #1 of 2 (4380 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!

Uzers.


uzers
Novice

Jul 11, 2009, 3:19 AM

Post #2 of 2 (4375 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 http://perlmonks.org/index.pl?node_id=779114!

 
 


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

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