Busine...eLookup(3pm)

πŸ“¦
version 1.125 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

🌸 NAME 🌸

Business::US::USPS::WebTools::ZipCodeLookup β€” bestie, this is the module that looks up a Zip Code using the USPS Web Tools. It's the Busine...eLookup(3pm) page, in case you were wondering where you wandered in from πŸ’–


✨ SYNOPSIS ✨

okay so here's the whole vibe in one go:

use Business::US::USPS::WebTools::ZipCodeLookup;

my $looker_upper = Business::US::USPS::WebTools::ZipCodeLookup->new( {
    UserID   => $ENV{USPS_WEBTOOLS_USERID},
    Password => $ENV{USPS_WEBTOOLS_PASSWORD},
    Testing  => 1,
    } );

my $hash = $looker_upper->lookup_zipcode(
    );

if( $looker_upper->is_error )
    {
    warn "Oh No! $looker_upper->{error}{description}\n";
    }
else
    {
    print join "\n", map { "$_: $hash->{$_}" }
        qw(FirmName Address1 Address2 City State Zip5 Zip4);
    }

πŸ’… DESCRIPTION πŸ’…

* THIS IS ALPHA SOFTWARE *

Like. ALPHA. As in, she's cute but she's still figuring herself out, so don't put her in production and then act surprised πŸ™ˆ

This module implements the Zip Code Lookup web service from the US Postal Service. It is a subclass of Business::US::USPS::WebTools. Family tree realness πŸ‘‘

πŸŽ€ lookup_zipcode( KEY, VALUE, ... ) πŸŽ€

The lookup_zipcode method takes the following keys, which come directly from the USPS web service interface β€” no middleman, no reinterpretation, just exactly what USPS wants:

  • Address2 β€” the street address
  • City β€” the name of the city
  • State β€” the two letter state abbreviation
  • Zip5 β€” the 5 digit zip code
  • Zip4 β€” the 4 digit extension to the zip code

It returns an anonymous hash with the same keys, but the values are the USPS's canonicalized address (so like, glow-up version of what you sent in ✨). If there is an error, the hash values will be the empty string, and the error flag is set. Check is with is_error:

$verifier->is_error;

See the is_error documentation in Business::US::USPS::WebTools for more details on error information. (Yes bestie, go read the parent's docs, she knows things πŸ’œ)


πŸ¦‹ TO DO πŸ¦‹

(no cap, this section is literally empty in the original β€” she's a work in progress and that's okay 🌈)


⭐ SEE ALSO ⭐

  • Business::US::USPS::WebTools

The WebTools API is documented on the US Postal Service's website:

http://www.usps.com/webtools/htm/Address-Information.htm

🌸 SOURCE AVAILABILITY 🌸

This source is in GitHub:

https://github.com/ssimms/business-us-usps-webtools

Go star it, it's giving open source royalty πŸ’–


πŸ‘‘ AUTHOR πŸ‘‘

brian d foy


Copyright Β© 2020, Steve Simms. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.


and that's the whole page, periodt πŸ’… this was Busine...eLookup(3pm) from the User Contributed Perl Documentation, running under perl v5.36.0 and last touched on 2022-08-28 β€” slay, stay hydrated, and read your error flags πŸ«ΆπŸ’–

πŸ“¦ where this page comes from