kill to send a signal by name or number to the process IDs listed in the remaining arguments:
kill 9 => $pid; # send $pid a signal 9 kill -1 => $pgrp; # send whole job a signal 1 kill USR1 => $$; # send myself a SIGUSR1 kill HUP => @pids; # send a SIGHUP to processes in @pids
kill function is an interface to the system call of the same name. The first argument is the signal to send, identified by number or by name; subsequent arguments are process IDs to send the signal to. It returns the count of processes successfully signaled. You can only send signals to processes running under the same real or saved UID as your real or effective UID - unless you're the superuser.
A process group is essentially a job. It's how the operating system ties related processes together. For example, when you use your shell to pipe one command into another, you've started two processes, but only one job. When you use Ctrl-C to interrupt the current job, or Ctrl-Z to suspend it, this sends the appropriate signals to the entire job, which may be more than one process.
kill can also check whether a process is alive. Sending the special pseudo-signal number 0 checks whether it's legal for you to send a signal to the process - without actually sending one. If it returns true, the process is still alive. If it returns false, the process has either changed its effective UID (in which case
$! will be set to EPERM) or no longer exists (and
$! is ESRCH). Zombie processes (as described in Recipe 16.19) also report back as ESRCH.