Business::PLZ - Map German postal codes to German states
use Business::PLZ; my $plz = Business::PLZ->new('12345'); # croaks on invalid code print "$plz"; # stringify $plz->state; # state or undef if not exist $plz->iso_state; # state as full ISO code
This module validates German postal codes and maps them to states.
Returns the state ("Bundesland") of a postal code as ISO 3166-2 subdivision code. The country prefix 'DE-' (or 'AT-' is not included). Some postal codes belong to more than one state - in this case only one state is returned. A future version of this module may also return multiple states.
If no state was found (so the postal code likely does not exists), this method returns undef. The method 'exists' is based on this lookup.
To get more information about a state, you can use Locale::SubCountry:
$state_code = $plz->state; $state_name = Locale::SubCountry->new('DE')->full_name( $state_code );
Returns the state of a postal code as ISO 3166-2 subdivision code, including country prefix.
Returns whether the postal code is assigned. This is exactely the case if it can be mapped to a state.
There are some country-specific modules to handle postal codes, for instance PT::PostalCode and Business::DK::PO. Geo::PostalAddress contains regular expressions for postal codes of almost every country.
Jakob Voss <firstname.lastname@example.org>
This software is copyright (c) 2011 by Jakob Voss <email@example.com>.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.