One thought on initialization: To improve readability and perhaps simplify maintenance, I would be inclined to store the list of information in a __DATA__ section and create the hash dynamically, something like this:
my %country_hash;
chomp (my @data_rows = <DATA>);
foreach my $this_country (@data_rows) {
my $country_code = substr($this_country,0,2);
my $country_name = substr($this_country,3);
$country_hash{$country_code} = $country_hash{$country_name} = $this_
+country;
}
# ... your tie code ...
__DATA__
AF Afghanistan
AL Albania
DZ Algeria
.....
In my eyes this would be easier to read and maintain. Also, special chars like the apostrophe Cote d'Ivoire no longer require escaping.