my $sth = $dbh->prepare("UPDATE $table SET upc=? WHERE item_id=?"); # ... if ($sth->execute($upc, $item_id)) { # ...