> I think I begin to understand...
> 
> I begin by fetching the results of the ps -efA command and split it
into many variables ($uid, $pid, etc.)
> 
>     open(PS, "ps -efA|"); 
>     while (<PS>) { 
>       ($uid,$pid,$ppid,$c,$stime,$tty,$time,$cmd) = split;
>         
>       if ($cmd =~ /dispatch genie/)  {
>           $infos{$pid}{'uid'}   = $uid;
>           $infos{$pid}{'ppid'}  = $ppid;
>           $infos{$pid}{'c'}     = $c;
>           $infos{$pid}{'stime'} = $stime;
>           $infos{$pid}{'tty'}   = $tty;
>           $infos{$pid}{'time'}  = $time;
>           $infos{$pid}{'cmd'}   = $cmd;
> 
> 
> I thought $cmd, as the last variable for the split command, would
contain the next word and also the rest of the line, which it does not.
It seems to take only the next word and do nothing with the rest of the
line.
> 
> So $cmd contains /prog/gena/8.1.1/bin/dispatch 
> 
> NOT /prog/gena/8.1.1/bin/dispatch genie -u /prog/gena/impress/gui/im
> 

Ah!  And now we have come full circle back to "Why you should use a
module to handle this type of code rather than re-inventing the wheel!"....

You don't risk breaking the spokes of the wheel while fixing the pedals
if you don't start out by reinventing the wheel to begin with...

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>


Reply via email to