my ($member,$total) = 'johndoe'; $total += $main{$_}{$member} for keys %main;