Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 taking refuge in the Monastery: (4)
As of 2024-04-25 10:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found