while (my ($month, $total) = each(%total_counts)) { print "$month: $total\m" ; } ; #### foreach my $month (sort keys %total_counts) { print "$month: $total_counts{$month}\n" ; } ; #### foreach my $month (sort_months(keys %total_counts)) { .... #### foreach my $user (sort keys %user_counts) { my $r_counts = $user_counts{$user} ; print "$user:\n" ; foreach my $month (sort_months(keys %$r_counts)) { my $count = $user_counts{$user}{$month} ; print " $month $count\n" ; } ; } ;