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.
In reply to Re^3: Cartesian Cross-Products
by waba
in thread Cartesian Cross-Products
by japhy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |