my $update_ids = $dbh->prepare(q/update queue set processed = ? where id = ?/); # later: $update_ids->execute('T', $ids); #### foreach my $id (@ids2process){ $count++; my $ret = HandleIds($id); next if($ret == -1); #### eval{ my $update_ids = $dbh->prepare("UPDATE queue set processed = \'T \' where id = $ids"); $updated = $update_ids->execute(); }; if($@) { $log->error("Unable to update record for - id: $id, updated: $updated");} else { $log->info("Updated record for - id: $id, updated: $updated");} #### $dbh->begin_work; #do my work; $dbh->commit;