in reply to Sort of a permutation

If you're looking at just generating all permutations you could just nest loops to go through each array. Off the top of my head, it would look like:

foreach $l1 (@one) { foreach $l2 (@two) { foreach $l3 (@three) { $permutation = $l1 . $l2 . $l3; # Do whatever } } }
This is very ugly code - take it more like the pseudo-code you asked for. I'm not a Perl adept, and I normally hesitate to put code where some of the giants of Perl here may see it, but what the heck.

Does this help?

=Blue
...you might be eaten by a grue...

Replies are listed 'Best First'.
RE: Re: Sort of a permutation
by KM (Priest) on Oct 18, 2000 at 20:27 UTC
    Hmmm.. not really the way I would want to do it if at all possible. But, I could try to make that way work. I think I may have been overthinking this :)

    Cheers,
    KM