my $idlist = join(',', map($dbh->quote($_),@id)); $statement = "SELECT id, size FROM table WHERE id IN ($idlist)";