Proc::Killfam - kill a list of pids, and all their sub-children
killfam $signal, @pids;
killfam accepts the same arguments as the Perl builtin kill command, but, additionally, recursively searches the process table for children and kills them as well.
killfam 'TERM', ($pid1, $pid2, @more_pids);
To install Proc::ProcessTable, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.