Hi, I'd like to thank you for your fast repsonse.

In regards to your solution, I've refrained from using hashes because I have elements/keys that appear more than once and I need to include them all in my final output.

For example, in file 2, the first three lines, would have the same key and different values. example:


cat1=cat2
cat1=cat9
cat1=cat10
FILE 1: dog1=bird2=cat1

So what I would have to do, is find a way to create three lines from FILE 1, push these into a new 2D array, and then join the values to the keys, so my new array will be.
index 0 - dog1=bird2=cat1=cat2
index 1 - dog1=bird2=cat1=cat9
index 2 - dog1=bird2=cat1=cat10

The reason I cannot use a hash is because in this case it would only create the first line:
index 0 - dog1=bird2=cat1=cat2
since hashes cannot have identical keys for different values.


In reply to Re^2: Help needed please: Data Manipulation in 2D Array by Syntenty
in thread Help needed please: Data Manipulation in 2D Array by Syntenty

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.