# ... your stuff here, to load $2 and %one with data push $users{$2}, \%one; ... my $user = $users{$key}; foreach $value ("pid", "cmd", "mem") { print %$user{$value}, " "; };