#!perl use warnings; use strict; open my $f,'<','pid.txt' or die "Start killme.pl first"; my $pid=<$f>; close $f; for my $sig (qw( HUP TERM KILL )) { print "Sending $sig ...\n"; kill($sig,$pid); sleep 2; }