use Proc::ProcessTable; my $running = 0; my $proc = Proc::ProcessTable->new; foreach ( @{ $proc->table } ) { if ($_->cmndline =~ /testd/) { ++$running; } } if (!$running) { # do something to reinvoke process }