in reply to Permutation algorithm?

The number of different arrays you'll get should equal 2^x, where x is the number of optional fields. Anything involving an exponential number of data structures should be avoided, so my strong sense is that what you're asking for is not what you need. What exactly are you using this data for?

Incidently, you definitly want to use hashes like Petruchio explained. I also feel like the input data structures of lists of integer values are... somewhat abstract and meaningless. In languages like C where it's difficult to wrap meaning up with context, this makes sense. In perl, there is probably a better way of further organizing this data.

To wit, can we have more context?

-Ted