I've got a bit of code that takes mailing addresses and compares them against the US Postal Service Webpage.
I need help getting Perl to Interpret or Ignore certain parts of the address.
Example
(user enters)
$address = "1313 Mockingbird Lane";
(postal service returns)
$post_address = "1313 MOCKINGBIRD LN";
if ($address ne $post_address) {
print "ERROR";
}
I get an error because the two don't match on "LANE vs. LN"
(I've taken care of the case-sensitivity by converting $address to uppercase.)
What I need help on is someway to tell Perl to accept either LANE or LN; DRIVE or DR; E. or EAST, etc. (it's the abbreviations that are causing me grief)
Any suggestions?
Right now I compare Address, City, State and Zipcode separately.
I need help getting Perl to Interpret or Ignore certain parts of the address.
Example
(user enters)
$address = "1313 Mockingbird Lane";
(postal service returns)
$post_address = "1313 MOCKINGBIRD LN";
if ($address ne $post_address) {
print "ERROR";
}
I get an error because the two don't match on "LANE vs. LN"
(I've taken care of the case-sensitivity by converting $address to uppercase.)
What I need help on is someway to tell Perl to accept either LANE or LN; DRIVE or DR; E. or EAST, etc. (it's the abbreviations that are causing me grief)
Any suggestions?
Right now I compare Address, City, State and Zipcode separately.