http://qs321.pair.com?node_id=664963

isutommyt has asked for the wisdom of the Perl Monks concerning the following question:

I'm not sure why I can't think today, but here is my problem.

I have a file that may look like this:
A,B
1,2
C,D,E

I need an output file that creates all possible permutations from that file:
A,1,C
A,1,D
A,1,E
A,2,C
A,2,D
... B,2,E (12 total possibilities)

Of course the original file can have a variable amount of "rows" and "columns". Help me monks! Thanks!