This software validates UK postcodes and identifies their location.
It is worth noting that Geo::Postcode does not check whether the supplied postcode exists or not. However, it will check whether the postcode is well-formed according to British Standard 7666, which you can refer to from the given link. Geo::Postcode can also work with partial codes, such as areas, districts, or sectors. These types of codes won't validate with the module, but you can check their legitimacy using the valid_fragment call. Moreover, Geo::Postcode can still turn partial codes into grid references.
If you want to use this module with US zipcodes, you should go for Geo::Postalcode instead. The module comes with multiple functions for different use cases. For example, you can create a new postcode object using the new function and check its validity using the valid function. You can also retrieve the coordinates of the postcode, either as separate grid references or as latitude and longitude using the coordinates or lat/long functions, respectively.
If you prefer a more concise syntax, you can skip the construction step and directly use the coordinates function with the postcode as a parameter. Besides, the module provides an analyze function for dissecting the postcode and returning its different parts.
Overall, Geo::Postcode is an excellent module for working with UK postcodes. It is easy to use, offers various functionalities, and can deal with partial postcodes. However, you should keep in mind that the module only validates the postcode according to the official spec and does not provide information on its existence.
Version 0.15: N/A