in reply to Database Insert Depending on Data Type

You can use placeholders, and let DBI do the work for you:
my $st = $dbh->prepare("Update tablename set columname = ?"); $st->execute($data);

There are other good reasons for placeholders, like security and speed.