in reply to SIG{ALRM} Question

I haven't tested this, but I have a guess as to the nature of your problem. The technique of kill('HUP', -$$) will not kill the child process unless the $$ of your "runtimed" program is the current process group id (which I guess it isn't in this situation). So you'll need to capture the child proc id directly using fork and exec:
my $status = 0; my $maxTime = shift @ARGV; my $runCmd = join ' ', @ARGV; my $child_pid; $SIG{ALRM} = sub { die "timeout" }; eval { alarm($maxTime); unless ($child_pid = fork) { exec $runCmd; die "could not exec $runCmd: $!"; } wait; alarm(0); }; if ($@) { if ($@ =~ /timeout/) { local $SIG{'HUP'} = 'IGNORE'; kill('HUP', $child_pid); $status = 1; } } exit $status;
Update: One other thing I forgot to mention - your original code traps the output of the "find" command and then discards it (that's what happens when you use backquotes and don't do anything with the return value) whereas mine allows it to be printed, so adjust accordingly as needed.