my $sth=$dbh->prepare("DELETE FROM table WHERE ". join(" or ",map { "message_id = $_" } @MESSAGE_IDS));