in reply to generate combinations of lists
Those are permutations, not combinations. Order doesn't matter for combinations.
Algorithm::Loops has a function called NextPermute which iterates permutations. Taken almost verbatim from the documentation:
use Algorithm::Loops qw( NextPermute ); my @list = sort qw( a b c ); do { print(join(', ', @list), "\n"); } while (NextPermute(@list));
|
|---|