This is not a Perl problem, as said in your title. Therefore, perlmonks is probably not the best place to be asking it. Since you know you have a MySQL problem, try looking through the docs on
. They have a great search engine and you can find anything you ever wanted to know. You need to be looking for things about 'Primary Keys' and 'Unique Indexes' to solve your problem.