Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: ps in perl?

by dug (Chaplain)
on Dec 26, 2007 at 19:03 UTC ( [id://659099]=note: print w/replies, xml ) Need Help??


in reply to Re: ps in perl?
in thread ps in perl?

Perl provides you with a mechanism for reading the output of a system command, via backticks or the qx operator, which means you can eliminate the temporary file and process the output directly:
foreach my $line ( qx[ps -ef] ) { # find the $line you're looking for }
I've used the Proc::ProcessTable module with success, and second McDarren's recommendation, though.

-- Douglas Hunter

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://659099]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2025-07-16 10:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.