in reply to How to kill an external program
The following code works for me. It assumes the process returns before it's done (I think all Win32 GUI programs do that, but command line ones don't - which sort are you using?).
my $PID = open my($Notepad), "|notepad.exe"; sleep 1; print "DIE!\n"; kill 9, $PID;
Perl Monks do it more than one way.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: How to kill an external program
by Anonymous Monk on Jan 13, 2003 at 22:03 UTC |
In Section
Seekers of Perl Wisdom