in reply to How to do with this hash?

Suwen,
da gave a good reply to your question but a few corrections were not pointed out. First, on your hash definition:
my %CountryCode = { 'com','Comercial', 'uk','The United Kingdom', } # a hash of country name
he corrected it as:
my %CountryCode = ( 'com','Comercial', 'uk','The United Kingdom' ); # a hash of country names
Note two things: 1) da changed your {}'s to ()'s (squiggles to parens) when intializing the hash; and 2) you left off a semicolon at the end of the statement.

Another thing not mentioned is your snippet:

if ($Country == $key){ #get the key of country name $CountryName = $CountryCode($key); #assign the key value to a varia +ble }
You should use ($Country eq $key) and not ($Country == $key).
eq is used for text comparison, == for numeric. suaveant's comment about sqiggles instead of parens applies to the $CountryCode($key) portion which should read $CountryCode{$key}.