in reply to Re: Re: funny results
in thread funny results: unexpected order reversal

I agree that the error you're seeing shouldn't be caused by this code, and that you should check to make sure that you wipe out your old dupes file before generating new results. Check out the other comments YuckFoo made on how you deal with files.

One other minor note, on style. Lines like this:

print NEWMASTER "$custID"." "."$ccn"." "."$expy"." "."$typ +e"." "."$amount\n";
...can be more cleanly written like this:
print NEWMASTER "$custID $ccn $expy $type $amount\n";
Or even better, you could have used a format.

buckaduck