Unix::Process - Perl extension to get pid info from (/bin/ps).
use Unix::Process; my $vsz = Unix::Process->vsz($$); my $pid = Unix::Process->pid;
All fields from the ps command can be fetched by calling a function of their name (see SYNOPSIS). If the pid is not given as an argument to the function, $$ (cur pid) is assumed.
This module is really just a giant AUTOLOAD to interact with the /bin/ps command. I suppose I could be talked into doing something real with it some day.
You can manually set the $Unix::Process::PS_PROGRAM = "/opt/bin/ps" by hand, or you can set $ENV{PS_PATH} = "/usr/local/bin/ps", but you must somehow instruct Unix::Process on the location of ps. Otherwise, it will guess "/bin/ps".
$Unix::Process::PS_PROGRAM = "/opt/bin/ps"
$ENV{PS_PATH} = "/usr/local/bin/ps"
"/bin/ps"
Paul Miller <jettero@cpan.org>
<jettero@cpan.org>
I am using this software in my own projects... If you find bugs, please please please let me know. :) Actually, let me know if you find it handy at all. Half the fun of releasing this stuff is knowing that people use it.
Copyright (c) 2007-2009 Paul Miller -- LGPL
perl(1), ps
To install Unix::Process, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Unix::Process
CPAN shell
perl -MCPAN -e shell install Unix::Process
For more information on module installation, please visit the detailed CPAN module installation guide.