in reply to Name Me! MixMatch?
WoopsRCS file: /home/perl/tools/Cartesian.pm,v retrieving revision 1.2 diff -r1.2 Cartesian.pm 30c30,31 < my $sizes = []; --- > my $div = []; > my $mod = []; 33,34c34,36 < push @$sizes, scalar(@$lref); < $total *= $sizes->[-1]; --- > push @$div, $total; > push @$mod, scalar(@$lref); > $total *= $mod->[-1]; 37,38c39,42 < $self->{sizes} = $sizes; < $self->{count} = $total; --- > $self->{div} = $div; > $self->{mod} = $mod; > $self->{total} = $total; > $self->{count} = 0; 44,45c48,49 < my $c = $self->{count}--; < return undef unless $c; --- > my $c = $self->{count}++; > return undef if ($c == $self->{total}); 48c52 < push @$ret, $self->{arr}->[$i]->[$c % $self->{sizes}->[$i]]; --- > push @$ret, $self->{arr}->[$i]->[($c / $self->{div}->[$i]) % + $self->{mod}->[$i]];
|
|---|