SyntaxFix
Write A Post
Hire A Developer
Questions
Also for eg. you can use IPC::Run:
use IPC::Run qw(run); my $pid = 5892; run [qw(top -H -n 1 -p), $pid], '|', sub { print grep { /myprocess/ } <STDIN> }, '|', [qw(wc -l)], '>', \my $out; print $out;