I asked a very similar question in the past, check it out: Conglomerate of arrays with no duplicates There were two modules posted in the comments there that do this exact thing. And they can do a recursive solution, so you can have an arbitrary number of sets.

In reply to Re: All Combinations of three arrays. by saberworks
in thread All Combinations of three arrays. by holli

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":