- or download this
#------------------------------------------------------------
# Return an iterator of all possible combinations (of all
...
my ($by, $next) = (0, 1);
return sub {
- or download this
# We're done after we've returned a list of all symbols
return () if @position == @list;
- or download this
if ( $next ) {
# We finished all combos of size $by, now do $by+1
$by++;
- or download this
# If new size is larger than list, we're done!
return () if $by > @list;
- or download this
# Start with leftmost $by symbols (except last,
...
return @list[ @position ];
}
}