in reply to Re: Using Perl to find Process Hogs
in thread Using Perl to find Process Hogs
With that said, here is some sample code on how it could be used:
(Much cleaner than my parsing of top)
#!/usr/bin/perl -w use strict; use Proc::ProcessTable; my $t = new Proc::ProcessTable; foreach my $proc ( @{$t->table} ){ print $proc->pid , " : " , $proc->pctcpu , "\n"; }
Cheers - L~R
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Using Perl to find Process Hogs
by Octavian (Monk) on Apr 18, 2003 at 12:41 UTC |