in reply to Trapping errors

I'm trying to trap those so I can get a realistic geocoding, but my error routine is just skipping it.
I'm not familiar with this module, but
eval{ $latlong = $geocoder->geocode(location => $location);
Apparently geocode dies here and the rest of the eval block is skipped. From the source of the module (V3):
$param{location} = shift; ... my $location = $param{location} or Carp::croak("Usage: geocode(location => \$location)");
Maybe try to check manually whether your $location is empty?