in reply to Re^2: Cartesian Cross-Products
in thread Cartesian Cross-Products
It is indeed the Perl way to do it if you know in advance how many arrays you'd like to get the product of.
If you don't, Japhy's algorithm is the way to go - even if it looks C-ish with a lot of indices. I suspect that it may be faster as well, using the array pre-allocation optimisation pointed out earlier.
|
|---|