in reply to How to do with this hash?
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
to lookup a hash use {} not () (squiggle brackets, not parens)$CountryName = $CountryCode{$CCode[-1]}; #assign the key value to a va +riable $CountryName = 'Unknown' unless $CountryName;
- Ant
|
|---|