Hi, I've been trying to do this for awhile, and can't seem to figure it out. What I have to work with is:

for $eve_one (0..scalar(@events_ns)-1) { $cur_ns = &pull_feilds_ns($eve_one); push @ns_games, $cur_ns; } for $games_ns_cart (0..scalar(@ns_games)-1) { @ns_games_rev = @ns_games; @ns_games_rev[$games_ns_cart] =~ s/(.*:.*):(.*:.*)/\1:\0/; } @ns_games_do = (@ns_games, @ns_games_rev); for $eve_two (0..scalar(@events_bb)-1) { $cur_bb = &pull_feilds_bb($eve_two); push @bb_games, $cur_bb; } @allgame = &combinations(\@bb_games, \@ns_games)}; @allgame_uniq = uniq(@allgame); return(\@allgame_uniq); }

In @bb_games and @ns_games_do is data like: Texas Rangers:1.78740157480315:New York Mets:2.15 Texas Rangers:1.78740157480315:Seattle Mariners:2.17 I want to be able to put both those sets of data into @allgame_uniq and return it to another subroutine for use like:

Texas Rangers:1.78740157480315:Seattle Mariners:2.17:Texas Rangers:1.7 +8740157480315:New York Mets:2.15

Then do:

@allgame_uniq = &permu();

so I can do something like print a line of the data with

@allgame_uniq[5].

I can't figure out how to do it, anybody have an idea?


In reply to Getting all combinations of 2 arrays in another array by oxagast

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.