Home : General : Perl Programming :

General: Perl Programming: 2 Servers giving different results - help!: Edit Log

Here is the list of edits for this post
2 Servers giving different results - help!
Hi,

Can anyone help me with this? My script is doing 2 different things on 2 different servers and I'm not sure why.

Here's the setup of my two servers:

Server 1 setup: perl, version 5.005_03 built for i386-linux
Server 2 setup: perl, v5.6.0 built for i386-linux

What's happening is this... in the code below I have 3 Economy "levels" inside $RatesExcludingGST. The script is meant to loop through the three levels and figure out which shipping rate to use, selecting the appropriate one for the weight of the order ($total_weight) and allocating the total to $shipping. The order weight I'm testing with is "125", so it should be selecting the "1000" economy level.

On server 1 it's working fine. But on server 2 it's always selecting the "5000" level.

If I remove the '5000' => '9.73' option from the levels, it works fine and selects 1000 as it should.

Can anyone tell me why?????

Thanks,

Regan.


Code:

$RatesExcludingGST = {

'Urgent' => {
'levels' => {
'5000' => '10.66'
},
'max' => '5000',
'increment' => '5000',
'excess' => '8.89'
},
'Economy' => {
'levels' => {
'1000' => '3.11',
'2000' => '4.22',
'5000' => '9.73'
},
'max' => '5000',
'increment' => '5000',
'excess' => '8.00'
}
};

$LEVELS = $RatesExcludingGST->{$method}->{'levels'};

while ( ($key, $val) = each ( %$LEVELS ) ) {

if ( $total_weight <= $key ) {
$shipping = $val; # the val equals the shipment amount
last; # this is the last loop
}
}

Last edited by:

ryel01: Aug 29, 2002, 4:05 PM

Edit Log: