in reply to Re: cartesian product preserving order
in thread cartesian product preserving order

Wow! Just wow! However, this solution seems not to cope with strings of arbitrary length. So I did some cargo cult programming and "invented" the delimiter.
my $combs = [ map { [split /\./] } glob '{CZK,EUR}.{asia,emea,na,sa}.{acad,sopr,user}' ];
But it feels like I brought some kludginess to the code that way. Punymonk

Replies are listed 'Best First'.
Re^3: cartesian product preserving order
by Zaxo (Archbishop) on Jun 09, 2005 at 08:35 UTC

    That's exactly how I would have handled longer elements. You can pick any seperator that suits the data.

    That's not cargo cult, it's adaptation. Glad you like it :-)

    After Compline,
    Zaxo