my @elements = qw(a b c); my $tupler = make_permutator(([@elements]) x 2 ); while (my @tuple = $tupler->() ){ print @tuple,"\n"; }