> Hi people, > > I want trap the results of 'ps -ef' command. > > 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. > > What would be the best data structure to use? An hash table in an array? ... >
Per my usual, no fun for anyone response, I would dispense with shelling out to ps, and use Proc::ProcessTable as your command is not cross platform compatible, error prone, slow, etc. then use its standard interface for retrieving the values you need when you need them... http://danconia.org -- Boycott the Sugar Bowl! You couldn't pay me to watch that game. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>