Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Running a command in Perl

by Tux (Monsignor)
on Jan 28, 2014 at 17:37 UTC ( #1072392=note: print w/ replies, xml ) Need Help??


in reply to Running a command in Perl

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

Enjoy, Have FUN! H.Merijn


Comment on Re: Running a command in Perl
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1072392]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2014-10-01 22:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (40 votes), past polls