(untested)
#!/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__
To get access to the pid I would use $process->pid.
No, you would use the pid() method on the objects of $process->table() which are instances of the class Proc::ProcessTable::Process.
In reply to Re: grep or exists
by blazar
in thread grep or exists
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |