in reply to Using Perl to update multiple Database Records but not all

I'd make the following recommendations:
  1. Put your csv files in your database. It's an extra table, but your data will become so much more usable and valuable.
  2. Create a "transaction register" table to reconcile the payments. The contents of your csv files would be entered into this table with positive amounts, and the data from ADP would be entered with negative amounts. Then you can use SQL to tell you if everything adds up.
The structure of the transaction register table would look something like this:
CREATE TABLE txn (txn_id INT PRIMARY KEY AUTO_INCREMENT, account VARCH +AR(64), amount INT); ALTER TABLE txn ADD INDEX i1 (account);
Then the contents of the first csv file would be entered with statements like the following:
INSERT INTO txn VALUES (NULL, '101', 40167); INSERT INTO txn VALUES (NULL, '101', 30821); ...
and the contents of the second csv file would be entered as:
INSERT INTO txn VALUES (NULL, '101', -131386);
To determine which accounts are not reconciled, perform the following query:
SELECT account, SUM(amount) as total FROM txn GROUP BY account HAVING +total <> 0;
and this will list the accounts and the amounts by which they are off.