#!/usr/bin/perl -w open(PH, "ps -A|"); while () { if (/q3ded/) { /\b(\d+)\b/; $pid = $1; } } print $pid;