Perl Home
PERL Functions
© 2011 TutorialsPoint.COM
|
PERL kill Function
Syntax
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
implementation
Name Effect
SIGABRT Aborts the process
SIGARLM Alarm signal
SIGFPE Arithmetic exception
SIGHUP Hang up.
SIGILL Illegal instruction
SIGINT Interrupt
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
|
Return Value
Example
Try out following example:
#!/usr/bin/perl
$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
|
|

|
|
|