in reply to Re^2: grep or exists
in thread grep or exists
Since you want the first match, which should be the only match, use List::Util's first:grep($_->pid == $wanted, @{$p->table} )
use List::Util qw(first); my $match = first {$_->pid == $wanted} @{$p->table};
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|