| WebService-UPS documentation | Contained in the WebService-UPS distribution. |
WebService::UPS::Address - Object to Represent Addresses
my $Package = WebService::UPS::TrackRequest->new;
$Package->Username('kbrandt');
$Package->Password('topsecrent');
$Package->License('8C3D7EE8FZZZZZ4');
$Package->TrackingNumber('1ZA45Y5111111111');
print $Package->Username();
my $trackedpackage = $Package->requestTrack();
my $address = $trackedpackage->getShipperAddress();
print $address->getZip();
WebService::UPS::Address->new( _address_hash => $object->getShipperAddress());
The constructor method that creates a new address Object. You probably should not be calling this directly as above, rather it should returned from the WebService::UPS::TrackedPackage Object
You shouldn't be messing with it in general. But if you dump it with dumper, and you are clever, you might be able to access things that my module doesn't have getters for.
$address->getCity()
This and the following objects return strings.
$address->getState()
$address->getCity()
$address->getAddressLine1()
$address->getAddressLine2()
Kyle Brandt, kyle@kbrandt.com http://www.kbrandt.com
| WebService-UPS documentation | Contained in the WebService-UPS distribution. |
# #=============================================================================== # FILE: Address.pm # DESCRIPTION: Address Object for use with UPS # AUTHOR: Kyle Brandt (mn), kyle@kbrandt.com , http://www.kbrandt.com #=============================================================================== package WebService::UPS::Address; use Mouse; has '_address_hash' => ( is => 'rw' ); sub getCity { my $self = shift; return $self->_address_hash()->{City} // ''; } sub getState { my $self = shift; return $self->_address_hash()->{StateProvinceCode} // ''; } sub getZip { my $self = shift; return $self->_address_hash()->{PostalCode} // ''; } sub getAddressLine1 { my $self = shift; return $self->_address_hash()->{AddressLine1} // ''; } sub getAddressLine2 { my $self = shift; return $self->_address_hash()->{AddressLine2} // ''; } 1;