in reply to Reporting empty cells in a table of records

Your question is a little confusing, but I think this will do it.
my %HASH = ( Canada => {apples => 1, watermelons => 1, orangesUPE => 1}, US => {applesAB => 1, pearsWE => 1}, Taiwan => {applesZB => 1, pearsDF => 1, orangesABC => 1} ); my %countriesbyfruit; my %countries; while (my ($country, $fruithash) = each %HASH){ $countries{$country} = 1; for my $fruit (keys %$fruithash){ $fruit =~ s/[A-Z]+$//; $countriesbyfruit{$fruit}{$country} = 1; } } for my $fruit (keys %countriesbyfruit){ for my $country (keys %countries){ print "$country is missing $fruit\n" unless exists $countriesb +yfruit{$fruit}{$country}; } }