in reply to Can a hash name have the same value twice.
open(MYFILE, "$cityfile") || die "Could not open $cityfile: $!\n"; while(<MYFILE>) { chomp; ($city, $country) = split(/:/, $_); $place{$country} .= "$city#"; } close(MYFILE); for $x (keys %place) { print "$x:\n"; for (split(/#/, $place{$x})) { print "\t$_\n"; } }
|
|---|