in reply to inserting in a database

I think I see what the problem is - in your inner loop, when you find a match you are inserting 'Feature', but you are not exiting that inner loop. Instead, you are continuing in the inner loop to process the next element of @idfeat. Try something like this (untested):
my $insert_sql = qq{ INSERT INTO dd VALUES(?, ?) }; my $sth_insert=$dbh->prepare($insert_sql); for (my $eu=0;$eu<=(scalar(@identifier));$eu++){ my $match_found = 0; foreach my $id(@idfeat) { if ($id eq $identifier[$eu]){ $match_found = 1; # found a match last; # break out of the foreach } } if ($match_found) { $sth_insert->execute($identifier[$eu], 'Feature'); } else { $sth_insert->execute($identifier[$eu], 'Bug'); } } $sth_insert->finish;
Read up on using 'placeholders' in the excellent DBI documentation by doing
perldoc DBI
at a command prompt. Using placeholders will only help you - they take care of all quoting issues (which can be a real pain in the butt), and they can improve performance.

HTH.