I think you'll find Set::CrossProduct does what you want.
In reply to Re: Easy way to find permutations? by adrianh in thread Easy way to find permutations? by Kratimoyporroon