in reply to inserting in a database
Read up on using 'placeholders' in the excellent DBI documentation by doingmy $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;
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.perldoc DBI
|
|---|