01: foreach $line() 02: { 03: chomp($line); 04: $line =~ s/"| //g; 05: @record = split(/,/,$line); 06: 07: #### The custhash is created from an index file. 08: if(!defined $custhash{$record[0]}[0]) 09: { 10: print "$line\n"; 11: next; 12: } 13: 14: $salesman = $custhash{$record[0]}[0]; 15: $custnum = $record[0]; 16: 17: #### The next 2 lines are not producing the expected result! 18: $hashlist{$salesman}{$custnum}[6] += $record[5]; 19: $hashlist{$salesman}{$custnum}[6] -= $record[7]; 20: 21: ##### These 3 lines I used for debug and the results are ??? 22: $orders += $record[5]; 23: $shipments += $record[7]; 24: $openorders += $hashlist{$salesman}{$custnum}[6]; 25: 26: #on hand inventory 27: $hashlist{$salesman}{$custnum}[8] += $record[6]; 28: 29: @duedate = split(/\//,$record[16]); 30: ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime; 31: 32: if(($duedate[0] == ($mon+1)) && ($duedate[2] == ($year-100))) 33: { 34: #due this month 35: $hashlist{$salesman}{$custnum}[7] += $record[9]; 36: } 37: } 38: close (FILE);