in reply to DBI conditional insert (and things of those nature)

as for your first question, There is a third method, besides using count(*) and sth->rows, and that is, write a PL/SQL function (return type varchar2) in Oracle,by passing it the primary key of the row to check for.if the row is not present, insert the row, or else return back the appropriate message like "row already exists". The advantage of this is that the code will be precompiled and on the database tier, will run faster, and can be called from more than one perl script, thus improving code reuse)...

as for your second problem, i've found that dbh->quote does work nicely to remove all the unwanted characters from the SQL i want to execute (thanks to blakem who pointed this out to me); instead of calling the filter sub for each variable, just form the SQL first and then write :
$dbh->quote($sql)