Geo::PostalCode might do what you want. Despite its name, it returns city and state in addition to ZIP codes. Compatible data files are currently only available for the US (AFAIK), but if you could find the required information for another area, getting it to work would simply require a short script to put the data in the right format.