Proc::Killall3pm
Kill all instances of a process by pattern matching the command-line
Usage
use Proc::Killall;killall('HUP', 'xterm'); # SIGHUP all xtermskillall('KILL', '^netscape$'); # SIGKILL to "netscape"
Overview
This module provides one function, killall(), which takes two parameters: a signal name or number (see kill()) and a process pattern. This pattern is matched against the process' command-line as the "ps" command would show it ("ps" is not used internally, instead a package called "Proc::ProcessTable" is used).
"killall" searches the process table and sends that signal to all processes which match the pattern. The return value is the number of processes that were successfully signaled. If any kills failed, the $! variable will be set based on that last one that failed (even if a successful kill happened afterward).
Prerequisites
"Proc::ProcessTable" is required for "Proc::Killall" to function.
Releases
13 releases since Debian 3.0 (Woody); the text changed 12 times.