in reply to Testing and combinations

Math::Combinatorics

Close. Try Set::CrossProduct.