Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: ps in perl?

by dug (Chaplain)
on Dec 26, 2007 at 19:03 UTC ( #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? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2023-03-31 03:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (74 votes). Check out past polls.

    Notices?