On Dec 16, 2003, at 7:13 AM, Hemond, Steve wrote: [..]
I first trap the results by splitting the results in scalar values such as $uid $pid $ppid $stime, etc...

I would like, for each line returned, to hold these values in an array, so that, for each uid, I could return its corresponding pid, ppid, stime, cmd, etc.
[..]

One strategy would be to go with

<http://search.cpan.org/~durist/Proc-ProcessTable-0.39/ProcessTable.pm>

from the CPAN.

An alternative strategy would be something like my
pet favorite Process Table Grovellor
<http://www.wetware.com/drieux/CS/Proj/PID/>

In my case I was not trying to use 'ps' as the all
singing all dancing process grabber - and hence went
with the simpler set of arguments to 'ps' that got me

userName PID PPID COMMAND

This started out from a question much like yours that
got me to a simple piece of code like:

<http://www.wetware.com/drieux/pbl/Sys/psTree.txt>

in which you can see that I use a hash of hashes

        {
                $pid => {
                                        $user => string,
                                        $cmd  => string,
                                }
        }

HTH.

ciao
drieux

---


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to