#!/usr/bin/perl use strict; use warnings; use Proc::ProcessTable; my $p=Proc::ProcessTable->new; my $wanted=1234; print "Found\n" if grep(/^$wanted$/,@{$p->table} );