Why not use Proc::ProcessTable:
$ cat mem.pl use 5.12.1; use warnings; use Data::Peek; use Proc::ProcessTable; my $s; $s += $_->{size} for grep { $_->cmndline =~ /java/ } @{Proc::ProcessTa +ble->new->table}; say $s; $ perl mem.pl 27656867840
In reply to Re: Running a command in Perl
by Tux
in thread Running a command in Perl
by thebeaniemonster
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |