Hi , I have approached this problem thru programming logic using recursive functions .May be its a little noobish but it gets the job done .any comments are welcome.

@array = ( [ "a", "b", "c", ], [ "1", "2", "3", "4", ], [ "x", "y", ], ["A","B","C"] ); our @initial_array = @{$array[0]}; our $i = 1 ; $stop = scalar (@array) ; recurse () ; sub recurse () { $k = 0 ; foreach (@initial_array) { $firstelement = $_ ; @next_array = @{$array[$i]} ; foreach (@next_array) { $combination +[$k]= $firstelement.$_ ; $k++ ; } } @initial_array = @combination ; $i++ ; if ( $i == $stop ) { print " @combination "; exit ; } else { recurse () ; } } output ______ a1xA a1xB a1xC a1yA a1yB a1yC a2xA a2xB a2xC a2yA a2yB a2yC a3xA a3xB +a3xC a3yA a3yB a3yC a4xA a4xB a4xC a4yA a4yB a4yC b1xA b1xB b1xC b1yA + b1yB b1yC b2xA b2xB b2xC b2yA b2yB b2yC b3xA b3xB b3xC b3yA b3yB b3y +C b4xA b4xB b4xC b4yA b4yB b4yC c1xA c1xB c1xC c1yA c1yB c1yC c2xA c2 +xB c2xC c2yA c2yB c2yC c3xA c3xB c3xC c3yA c3yB c3yC c4xA c4xB c4xC c +4yA c4yB c4yC

In reply to Re: Generating all possible combinations from an AoA by dj_nitrkl
in thread Generating all possible combinations from an AoA by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.