[ic] str_length mis-behavior?

Mike Heins interchange-users@interchange.redhat.com
Sun Feb 3 01:09:00 2002


Quoting Tim Murphy (goombah@netcom.ca):
> Hello,
> 
> 	The last piece of the puzzle... I'm having trouble figuring out how the zip 
> length can be modified when doing UPS lookups. It appears that I can't do a 
> lookup unless the string length of the zip value is at least 3 characters. 
> Quick background: I'm using <zip> with 3 characters from the Canadian Postal 
> Code to get domestic shipping costs, <state> with 2 characters to get US 
> shipping costs, and <country> with 2 characters to get international costs. 
> The domestic shipping works fine (i.e. zip = "A0A", "B1B", etc.). Trying a US 
> or International destination always returns: 
> 
> "Note: No zone found for geo code <2 letter state or country code here> type 
> PIS." 

I think you may have found a bug. Try this patch to lib/Vend/Interpolate.pm:

--- /R/Interpolate.pm	Thu Jan 24 13:57:12 2002
+++ /tmp/Interpolate.pm	Sun Feb  3 01:07:32 2002
@@ -6027,7 +6027,7 @@
 			}
 			my (@zone) = grep /\S/, split /[\r\n]+/, $ref->{zone_data};
 			if($zone[0] !~ /\t/) {
-				my $len = $ref->{str_len} || 3;
+				my $len = $ref->{str_length} || 3;
 				@zone = grep /\S/, @zone;
 				@zone = grep /^[^"]/, @zone;
 				$zone[0] =~ s/[^\w,]//g;

-- 
Red Hat, Inc., 3005 Nichols Rd., Hamilton, OH  45013
phone +1.513.523.7621      <mheins@redhat.com>

Be patient. God isn't finished with me yet.  -- unknown