kill - perldoc.perl.org

Perl Programming Documentation
Download Perl
Explore

Manual

- Overview
- Tutorials
- FAQs
- History / Changes
- License

Reference

- Language
- Functions
- Operators
- Special Variables
- Pragmas
- Utilities
- Internals
- Platform Specific

Modules

- A • B • C • D • E
- F • G • H • I • L
- M • N • O • P • S
- T • U • X

Tools

- Preferences

# kill

Perl 5 version 12.2 documentation
Go to top
Show recent pages
Recently read

# kill

Perl functions A-Z | Perl functions by category | The 'perlfunc' manpage

- kill SIGNAL, LIST

  Sends a signal to a list of processes. Returns the number of processes successfully signaled (which is not necessarily the same as the number actually killed).

          $cnt = kill 1, $child1, $child2;    kill 9, @goners;

  If SIGNAL is zero, no signal is sent to the process, but `kill` checks whether it's possible to send a signal to it (that means, to be brief, that the process is owned by the same user, or we are the super-user). This is useful to check that a child process is still alive (even if only as a zombie) and hasn't changed its UID. See perlport for notes on the portability of this construct.

  Unlike in the shell, if SIGNAL is negative, it kills process groups instead of processes. That means you usually want to use positive not negative signals. You may also use a signal name in quotes.

  The behavior of kill when a PROCESS number is zero or negative depends on the operating system. For example, on POSIX-conforming systems, zero will signal the current process group and -1 will signal all processes.

  See Signals in perlipc for more details.