
   while (<>) {
     chomp;
     my ($city, $country) = split /, /;
     push @{$table{$country}}, $city;
   }

   for $country (sort keys %table) {
     print "$country: ";
     my @cities = sort @{$table{$country}};
     print join(", ", @cities), "\n";
   }

