my $stmt = "SELECT somedata FROM table WHERE id IN( " . join( ", ", @ids_to_match . " )";