in reply to Upper limit on length of arrays accepted by Set::CrossProduct
sub cardinality { my $self = shift; my $product = 1; foreach my $length ( @{ $self->{lengths} } ) { $product *= ( $length + 1 ); } return $product; }
And $self->{lengths} is initialized like this:
$self->{lengths} = [ map { $#{$_} } @$array_ref ];
Looks right to me, and doesn't look like a length limit.
Could you try to find a data sample where cardinality returns 0?
The simplest explanation is that one of your arrays is empty.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Upper limit on length of arrays accepted by Set::CrossProduct
by nikhil.patil (Sexton) on Jan 29, 2008 at 12:30 UTC | |
by MidLifeXis (Monsignor) on Jan 29, 2008 at 18:09 UTC | |
by Arunbear (Prior) on Jan 29, 2008 at 18:23 UTC | |
by nikhil.patil (Sexton) on Jan 30, 2008 at 12:17 UTC | |
by blazar (Canon) on Jan 30, 2008 at 13:21 UTC |