in reply to Killing child process
To quote the perlfunc manpage for kill,
Unlike in the shell, if SIGNAL is negative, it kills process groups instead of processes. (On System V, a negative PROCESS number will also kill process groups, but that's not portable.) That means you usually want to use positive not negative signals.So all you have to do is call kill with the negative value for the signal you want. E.g. kill -9, $pid;. If you want to use the name of a signal, I think you'll have to do something like:
(If you leave out the space after the minus sign, you'll get a warning message like "Ambiguous use of -SIGKILL resolved as -&SIGKILL()". Of course you could type kill -&SIGKILL(), $pid, but it seems easier to just leave a space).use POSIX; kill - SIGKILL, $pid;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Killing child process
by sgifford (Prior) on Oct 12, 2003 at 15:49 UTC | |
by Thelonius (Priest) on Oct 13, 2003 at 02:20 UTC | |
by sgifford (Prior) on Oct 13, 2003 at 03:31 UTC | |
by pg (Canon) on Oct 12, 2003 at 17:02 UTC | |
by sgifford (Prior) on Oct 12, 2003 at 17:42 UTC |
In Section
Seekers of Perl Wisdom