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


in reply to Creating tuples based on sets

You'll have to have multiple foreach loops that go through each item in the set. For tuples of size 2, you'll need two. For tuples of size 3, you'll need three. You get the idea. You might be able to use Algorithm::Loops to help you with this.