Geo::Postcodes - Base class for the Geo::Postcodes::* modules
This module should not be used directly from application programs, but from a country subclass; e.g.:
package Geo::Postcodes::U2; use Geo::Postcodes 0.30; use base qw(Geo::Postcodes); use strict; use warnings; our $VERSION = '0.30';
And so on. See the documentation for making country subclasses for the gory details; perldoc Geo::Postcodes::Subclass or man Geo::Postcodes::Subclass.
Geo::Postcodes - Base class for the Geo::Postcodes::* modules. It is useless on its own.
These procedures and methods should, with a few exceptions, not be used directly, but from a country module. See the documentation for the indiviual country modules for usage details.
Methods for accessing the fields of a postcode object. The individual country modules can support as many of them as needed, and add new ones.
Procedures that returns the value of the corresponding field for the given postcode. They will return undef if the postcode does not exist, or the field is without value for the given postcode.
get_fields() will return a list of all the fields supported by the module, and is_field($field) will return true (1) if the specified field is supported by the module.
Procedures that return true if the postcode is legal (syntactically), or valid (in actual use).
This will create a new postcode object.
Procedures/methods for selecting several postcodes at once.
See the selection manual (perldoc Geo::Postcodes::Selection or man Geo::Postcodes::Selection) for usage details, and the tutorial (perldoc Geo::Postcodes::Tutorial or man Geo::Postcodes::Tutorial) for sample code.
Supporting procedures when using selection or selection_loop.
See the selection manual; perldoc Geo::Postcodes::Selection or man Geo::Postcodes::Selection for usage details.
This will return an unsorted list of all the postcodes.
This will return a list of types. See the next section.
my $type_as_english_text = $Geo::Postcodes::type2verbose($type); my $type_as_national_text = $Geo::Postcodes::U2:type2verbose($type);
This procedure gives an english description of the type. Use the child class directly for a description in the native language.
This class defines the following types for the postal locations:
Post Office box
Street address
Service box (as a Post Office box, but the mail is delivered to the customer).
Individual owner (a company with its own postcode).
Either a Street address (ST) or a Post Office box (BX)
Multiple usage (a mix of the other types)
Porto Paye receiver (mail where the reicever will pay the postage).
Place name
The child classes can use them all, or only a subset, but must not define their own additions. The child classes are responsible for adding descriptions in the native language, if appropriate.
This is the base class for the Geo::Postcodes::* modules.
This module uses inside out objects, see for instance http://www.stonehenge.com/merlyn/UnixReview/col63.html for a discussion of the concept.
See also the selection manual (perldoc Geo::Postcodes::Selection or man Geo::Postcodes::Selection) for usage details, the tutorial (perldoc Geo::Postcodes::Tutorial or man Geo::Postcodes::Tutorial) for sample code, and the ajax tutorial (perldoc Geo::Postcodes::Ajax or man Geo::Postcodes::Ajax) for information on using the modules in combination with ajax code in a html form to get the location updated automatically.
The latest version of this library should always be available on CPAN, but see also the library home page; http://bbop.org/perl/GeoPostcodes for additional information and sample usage. The child classes that can be found there have some sample programs.
Copyright (C) 2006 by Arne Sommer - perl@bbop.org
This library is free software; you can redistribute them and/or modify it under the same terms as Perl itself.
To install Geo::Postcodes, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Geo::Postcodes
CPAN shell
perl -MCPAN -e shell install Geo::Postcodes
For more information on module installation, please visit the detailed CPAN module installation guide.