use Proc::ProcessTable; my $procs = Proc::ProcessTable->new; foreach ($procs->table) { if ($_->pid = $required_pid) { print $_->cmndline; last; } }