in reply to Combinations of multiple arrays

I spent a day trying to no avail.

You should show your effort.

I wonder if somebody already solved this problem.

Why not check? combinations, combinations site:perlmonks.org, combinations site:cpan.org