in reply to DBI Inserting Duplicate Records

First, a slightly off-topic suggestion: put the "prepare()" statement outside (above) the while loop -- one of the advantages of using placeholders is "prepare once, execute often", because this saves a lot of overhead on the DB server side. (This would also involve putting the "finish()" call after the loop.)

Getting back on topic, is it possible that the table definition on the remote server is different from the one on your local machine? E.g. maybe your local version has a uniqueness constraint that isn't being applied on the remote server's version?

Another issue, since the stored procedure controls insertion by querying for values of "col1 FROM tableX WHERE col3 = @field1", is whether this other table on the remote server contains the same data as your local version.

A third thing to check is whether the input data files being used locally vs. remotely really are the same. Could the remote server be getting a "longer" version of the CSV file? (Who knows how it might have gotten "longer"... still it's worth checking to be sure.)

I don't see anything in the perl code that would lead to different behaviors depending on local vs. remote (CGI?) runtime environments. The differences are most likely a matter of table definitions or data.