in reply to Re^2: Upper limit on length of arrays accepted by Set::CrossProduct
in thread Upper limit on length of arrays accepted by Set::CrossProduct

When you find a solution, please do not delete the content of the original node. The thread is next to worthless when that happens.

If it happened accidentally, then never mind ;)

--MidLifeXis

  • Comment on Re^3: Upper limit on length of arrays accepted by Set::CrossProduct

Replies are listed 'Best First'.
Re^4: Upper limit on length of arrays accepted by Set::CrossProduct
by Arunbear (Prior) on Jan 29, 2008 at 18:23 UTC
    The content has now been restored.
Re^4: Upper limit on length of arrays accepted by Set::CrossProduct
by nikhil.patil (Sexton) on Jan 30, 2008 at 12:17 UTC
    The original node accidentally got deleted when I attempted to update it. I wanted to post the following code along with the question so as to give an idea about the syntax I'm using.
    #!/usr/bin/perl use Set::CrossProduct; my @arr; my @arr1 = 0..4; my @arr2 = 0..3; my @arr3 = 0..10; push(@arr,\@arr1); push(@arr,\@arr2); push(@arr,\@arr3); my $i = Set::CrossProduct->new(\@arr); print $i->cardinality, "\n"; while (my $a = $i->get) { print "@$a : "; };

      I personally believe that on an OT basis, you may be interested to know a slightly more concise but IMHO not less clear way to build @arr:

      my @arr=map [0..$_], 4,3,10;

      Actually, you don't even need @arr:

      my $i = Set::CrossProduct->new([map [0..$_], 4,3,10]);
      --
      If you can't understand the incipit, then please check the IPB Campaign.