http://www.perlmonks.org?node_id=817524


in reply to Combinations of multiple arrays

Iterator::Array::Jagged does exactly what you're trying to do