use Math::Combinatorics; my @cols = (0..12); my @combin; my @data = ('A'..'Z'); my $combinations = Math::Combinatorics->new(count => 10, data => [@cols]); while (@combin = $combinations->next_combination()) { print join("\t", @data[@combin]), "\n"; }