After a little work figuring out the simplest API, Philippe "BooK" Bruhat and I have a generic gazetteer API: WWW::Gazetteer. It's a factory class, so you need to install ::Calle or ::HeavensAbove, but is dead easy to use. The following code uses both modules:
#!/usr/bin/perl -w
use strict;
use WWW::Gazetteer;
use YAML;
my $g1 = WWW::Gazetteer->new('calle');
my $g2 = WWW::Gazetteer->new('heavensabove');
print Dump($g1->find("Bath", "GB"));
print Dump($g2->find("Bath", "GB"));
and it prints out:
--- #YAML:1.0 city: Bath country: GB elevation: 132 latitude: 51.3833 longitude: -2.3500 --- #YAML:1.0 alias: '' elevation: 74 latitude: 51.378 longitude: -2.366 name: Bath region: Avon regionname: county
Now how many subclasses are we going to have? ;-)
PS: Don't use this for navigation!
Nicely done.