in reply to Problem subtracting in Perl
If you process two records with the same $salesman and $custnum, the $hashlist amount is getting added to $openorders twice. To fix this, subtract current $hashlist amount from $openorders, adjust the $hashlist amount, then add it back to $openorders. Hope this makes sense,
YuckFoo
#### Add this line to fix ??? $openorders -= $hashlist{$salesman}{$custnum}[6]; $hashlist{$salesman}{$custnum}[6] += $record[5]; $hashlist{$salesman}{$custnum}[6] -= $record[7]; ##### These 3 lines I used for debug and the results are ??? $orders += $record[5]; $shipments += $record[7]; $openorders += $hashlist{$salesman}{$custnum}[6];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Problem subtracting in Perl
by diakonos (Hermit) on Jan 18, 2002 at 00:49 UTC |