in reply to ps in perl?

Or, if you donm't like either of the previous solutions you could do

system( 'ps -ef >/tmp/ps.txt' );

After which you could load the contents of /tmp/ps.txt. It's not elegant, but it's simple and removes a dependency.

Replies are listed 'Best First'.
Re^2: ps in perl?
by dug (Chaplain) on Dec 26, 2007 at 19:03 UTC
    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