isutommyt,
Please note that what you are asking for is a specific type of combinations not permutations. In permutations, order is important so "A, 1, C" is not the same as "A, C, 1". I say a specific type of combination because you are asking for all possible combinations selecting 1 item from each group - a more general combination may have "C, D, 2".
One module has already been suggested. I would suggest Algorithm::Loops and tell you that solving the problem yourself is quite fun.