use strict; use vars qw(%h1 %h2); sub get_statm_info { my $error = ''; my $ref = {}; if( ! open(_INFO,"); close(_INFO); ### these are all the props (skip some) # size resident shared trs lrs drs dt ### ### get the important ones $ref = {size => $info[0] * 4, resident => $info[1] * 4, shared => $info[2] * 4}; return $ref; } # Double hash case. %h1 = map { $_, 16 } 1..10000; %h2 = map { $_, 20 } 1..10000; # Single hash of arrays. #%h1 = map { $_, [16,20] } 1..10000; my $ref = get_statm_info($$); print $ref->{size},"\n"; print $ref->{resident},"\n"; print $ref->{shared},"\n";