#!/usr/bin/perl use strict; use warnings; use Proc::ProcessTable; my $p=Proc::ProcessTable->new; my $wanted=1234; for ( @{$p->table} ) { print "Found\n" and last if $_->pid == $wanted; } __END__