in reply to Re: grep or exists
in thread grep or exists

grep(/^$wanted$/,@{$p->table} )
There is abolutely no need to limit use of grep in Perl to regular expressions. Any kind of boolean expression, or expression used as a boolean, for the filter condition, will do. For example:
grep($_ == $wanted, @{$p->table} )
update: Better, as blazar points out, code that actually works for this case:
grep($_->pid == $wanted, @{$p->table} )

Replies are listed 'Best First'.
Re^3: grep or exists
by merlyn (Sage) on May 16, 2006 at 13:23 UTC