in reply to How to do with this hash?

my @CCode = split /./, $remote_host; # split every portion

This line will split on every char and leave you nothing... put a \ in front of the .

my @CCode = split /\./, $remote_host; # split every portion

Update ahh... also, instead of your for loop just do

$CountryName = $CountryCode{$CCode[-1]}; #assign the key value to a va +riable $CountryName = 'Unknown' unless $CountryName;
to lookup a hash use {} not () (squiggle brackets, not parens)

                - Ant