for my $key (keys %data) { print "\n$key"; my $h_ref = $data{$key}; printf "\t%s\t%6.2f\n", $_, $h_ref->{$_} for keys %$h_ref; }