use strict; use Proc::ProcessTable; my $table=Proc::ProcessTable->new; my @procs=$table->table; foreach $p ($table->table) { if ($p->pid == $saved_pid) { send_signal() if ($p->cmdline eq "expected command line"); } } #Warning: code is utterly untested and not the most efficient either.