#!/usr/local/bin/perl open PS,"/bin/ps -eo pid,args|"; while() { ($pid,$args) = split(" ",$_,2); foreach my $test (@ARGV) { if($pid ne $$ and $args =~ /$test/) { print "Killing: $_\n"; kill 9 => $pid; } } } close PS;