The kill() Function in Perl


Perl kill('KILL', (Process List)) function can be used to terminate a pseudo-process by passing it the ID returned by fork().

Note that using kill('KILL', (Process List)) on a pseudo-process() may typically cause memory leaks, because the thread that implements the pseudo-process does not get a chance to clean up its resources.

You can use kill() function to send any other signal to target processes, for example following will send SIGINT to a process IDs 104 and 102 −

#!/usr/bin/perl
kill('INT', 104, 102);
1;

Updated on: 02-Dec-2019

615 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements