Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.2 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    Geo::PostalAddress 0.04

    Download button

    No screenshots available
    Downloads: 368  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Poor (1.7/5)
    4 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Michel Lavondes | More programs
    Perl Artistic License / FREE
    February 25th, 2008, 12:38 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Geo::PostalAddress description

    Geo::PostalAddress is a Perl module for country-specific postal address parsing/formatting.

    Geo::PostalAddress is a Perl module for country-specific postal address parsing/formatting.

    This module converts postal (snail mail) addresses between an unstructured country-neutral format (an array of character strings) and a country-specific format that's hopefully meaningful by postal authorities, courier/delivery services, residents, ... of that country for postal address entry. It should handle most countries out of the box with only minor or technical divergences from approved bulk-mailing formats; if needed, country-specific code can be added to make it fully conformant to those formats.

    The intended audience for this module is anyone needing to handle most addresses in a recognizable country-specific format, without going into the full generality and complexity that UPU standards would appear to require.

    SYNOPSIS

    use Geo::PostalAddress;

    my $AU_parser = Geo::PostalAddress->new('AU');
    my $format = $AU_parser->format();
    # $format now contains:
    # [['Addr1', 40], ['Addr2', 40], ['Addr3', 40], ['Addr4', 40], 3,
    # ['City', 40],
    # ['State', {NSW => "New South Wales", TAS => "Tasmania",
    # QLD => "Queensland", SA => "South Australia",
    # WA => "Western Australia", VIC => "Victoria",
    # ACT => "Australian Capital Territory",
    # NT => "Northern Territory"}], ['Postcode', 4, qr/^dddd$/]]
    # 40 in ['Addr1', 40] is the suggested displayed field width (not the maximum
    # length). 3 means that the next 3 fields should/could be on the same row.
    # ['State', {...}] means an enumerated list is used for this field, with keys
    # being the stored values and values being the labels used for display or
    # selection.
    my $display = $AU_parser->display(["4360 DUKES RD", "KALGOORLIE WA 6430"]);
    # $display now contains:
    # {Addr1 => "4360 DUKES RD", City => "KALGOORLIE",
    # State => "WA", Postcode => "6430"}

    my $US_parser = Geo::PostalAddress->new('US');
    my $address = {Addr1 => "123 MAGNOLIA ST", City => "HEMPSTEAD",
    State => "NY", ZIP => "11550­1234"};
    my $result = $US_parser->storage($address);
    unless (ref $result) { carp "Bad postal address: $result.n"; }

    my $AU_to_US_address_label = $US_parser->label("AU", "MR JOHN DOE", $result);
    # What to print on an address label or on an envelope, if mailing from
    # Australia to the United States.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    postal address parsing | postal address formatting | Perl module | postal | address | parser

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM