my $ids_in = join ", ", @in; my $sql = "select id, size from table where id in ($ids_in)";