#!/usr/bin/perl -wT use CGI; use CGI::Carp qw(fatalsToBrowser); use DBI; use strict; use warnings; ... my $sth = $dbh->prepare(qq{UPDATE $regtable SET favorites=? WHERE ID=?}); $sth->execute($favorites, $ID) or die $dbh->errstr; ...