Skip Menu |

This queue is for tickets about the Business-Shipping CPAN distribution.

Report information
The Basics
Id: 16685
Status: resolved
Priority: 0/
Queue: Business-Shipping

People
Owner: Nobody in particular
Requestors: ZACKSE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.01
Fixed in: 2.03



Subject: off by one error in fuel surcharge update script
In the script that updates fuel surcharges (recommended to be run monthly), there is an off-by-one error in the loop that checks for the month. Attached is a patch to fix this problem. Thanks for your work on this module, we've used it with great success on several different web sites.
diff -ur Business-Shipping-2.01.orig/bin/Business-Shipping-UPS_Offline-update-fuel-surcharge.pl Business-Shipping-2.01/bin/Business-Shipping-UPS_Offline-update-fuel-surcharge.pl --- Business-Shipping-2.01.orig/bin/Business-Shipping-UPS_Offline-update-fuel-surcharge.pl 2005-09-16 21:19:17.000000000 -0400 +++ Business-Shipping-2.01/bin/Business-Shipping-UPS_Offline-update-fuel-surcharge.pl 2005-12-22 13:51:54.555017136 -0500 @@ -131,7 +131,7 @@ my %cur = %{ $rates->{ $service_type }{ $date_type } }; my $found_month; - for my $c ( 1 .. @month_names ) { + for my $c ( 0 .. $#month_names ) { if ( $cur{ month } eq $month_names[ $c ] ) { $cur{ month } = $c; $found_month = 1;
[ZACKSE - Thu Dec 22 13:57:06 2005]: Show quoted text
> In the script that updates fuel surcharges (recommended to be run > monthly), there is an off-by-one error in the loop that checks for > the month. Attached is a patch to fix this problem.
Thank you. As it happens, this bug was already fixed in 2.02 (Oct 7).
[DBROWNING - Thu Dec 22 14:47:20 2005]: Show quoted text
> [ZACKSE - Thu Dec 22 13:57:06 2005]:
> > In the script that updates fuel surcharges (recommended to be run > > monthly), there is an off-by-one error in the loop that checks
> for
> > the month. Attached is a patch to fix this problem.
> > Thank you. As it happens, this bug was already fixed in 2.02 (Oct 7).
:( Oops. It turns out that PAUSE errored out on my release and I never noticed; so 2.02 wasn't release on Oct 7th at all. Needless to say, a new B::Shipping release is on the way.