- Perl Basics
- Perl - Home
- Perl - Introduction
- Perl - Environment
- Perl - Syntax Overview
- Perl - Data Types
- Perl - Variables
- Perl - Scalars
- Perl - Arrays
- Perl - Hashes
- Perl - IF...ELSE
- Perl - Loops
- Perl - Operators
- Perl - Date & Time
- Perl - Subroutines
- Perl - References
- Perl - Formats
- Perl - File I/O
- Perl - Directories
- Perl - Error Handling
- Perl - Special Variables
- Perl - Coding Standard
- Perl - Regular Expressions
- Perl - Sending Email
- Perl Advanced
- Perl - Socket Programming
- Perl - Object Oriented
- Perl - Database Access
- Perl - CGI Programming
- Perl - Packages & Modules
- Perl - Process Management
- Perl - Embedded Documentation
- Perl - Functions References
- Perl Useful Resources
- Perl - Questions and Answers
- Perl - Quick Guide
- Perl - Useful Resources
- Perl - Discussion
Perl kill Function
Description
This function 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
Syntax
Following is the simple syntax for this function −
kill EXPR, LIST
Return Value
This function returns the number of processes successfully signaled.
Example
Following is the example code showing its basic usage −
#!/usr/bin/perl $cnt = kill 0, getppid(), getpgrp(), 2000; print "Signal sent to $cnt process\n";
When above code is executed, it produces the following result −
Signal sent to 2 process
perl_function_references.htm
Advertisements