Process(3)
π NAME π
Unix::Process β a Perl extension that pulls pid info straight out of /usr/bin/ps. no cap. π«Ά
β¨ SYNOPSIS β¨
use Unix::Process;
my $vsz = Unix::Process->vsz($$);
my $pid = Unix::Process->pid;
πΈ DESCRIPTION πΈ
okay bestie, here's the whole vibe: every single field that the ps command gives you can be fetched by just calling a function named after that field (peep the SYNOPSIS, it's right there π
). And if you don't hand the function a pid as an argument, it just assumes $$ β aka the current pid. easy. β¨
This module is literally just one giant AUTOLOAD that goes and chats with the /usr/bin/ps command. iconic behavior honestly. the author says he supposes he could be talked into doing something real with it some day π β so like, lowkey it's a vibe, not a lifestyle.
Now for the part you actually need, so listen up π: you can manually set
$Unix::Process::PS_PROGRAM = "/opt/bin/ps"
by hand, or you can set
$ENV{PS_PATH} = "/usr/local/bin/ps"
β but either way you must somehow tell Unix::Process where ps lives. Otherwise? It's gonna guess /usr/bin/ps and hope for the best π.
π AUTHOR π
Paul Miller <jettero@cpan.org>
He says he's using this software in his own projects... and if you find bugs, please please please let him know. :) Actually β let him know if you find it handy at all. Half the fun of releasing this stuff is knowing that people use it. π₯Ή that's so real of him fr fr π
π COPYRIGHT π
Copyright (c) 2007-2009 Paul Miller -- LGPL
π¦ SEE ALSO π¦
perl(1)ps
and that's the whole page, bestie β this one's from perl v5.42.0, dated 2025-07-25, filed under Process(3) in the User Contributed Perl Documentation. slay, go get those pids π β¨
π¦ where this page comes from
- fedora 43: perl-Unix-Process 1.3101-25.fc43 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms