© 2013 TutorialsPoint.COM
PERL kill Function
Definition and Usage
Sends a signal to a list of processes. Returns the number of processes successfully signaled.
If SIGNAL is zero, no signal is sent to the process. This is a useful way to check that a child process is alive and hasn't changed its UID.
The precise list of signals supported is entirely dependent on the system
SIGABRT Aborts the process
SIGARLM Alarm signal
SIGFPE Arithmetic exception
SIGHUP Hang up.
SIGILL Illegal instruction
SIGKILL Termination signal
SIGPIPE Write to a pipe with no readers.
SIGQUIT Quit signal.
SIGSEGV Segmentation fault
SIGTERM Termination signal
SIGUSER1 Application-defined signal 1
SIGUSER2 Application-defined signal 2
Try out following example:
$cnt = kill 0, getppid(), getpgrp(), 2000;
print "Signal sent to $cnt process\n";
It will produce foillowing result, because process 2000 does not exist
Signal sent to 2 process