in reply to Re: Permutations question
in thread Permutations question
Or, if we want to exactly match the original request, it is easy to transform to:
use Algorithm::Loops qw( NestedLoops ); sub expandSubLists { my $av= shift(@_); return [ NestedLoops( [ map ref($_) ? $_ : [$_], @$av ], sub { [@_] }, ), ]; }
which, of course, chews up a lot of memory if given a lot of selections to generate.
- tye
|
|---|