Dear monks
I know the issue of comparing arrays was discussed extensively but I could not find an answer to the issue below:
I have two arrays, the first is representing the content of a table at time X and the second array is the content of the same table after a period of time and some changes.
I need to think of an algorithm to compare the two arrays, find the difference, check what element moved where.
Is there a module that addresses this issue, do you have an idea?
Here is an example of the table at time A:
1 b Uniq 2 f Uniq 3 c Uniq 4 a Uniq 5 e Uniq 6 c Uniq 7 a Uniq 8 b Uniq 9 d Burn 10 d Burn 11 e Burn 12 a Burn 13 f Burn 14 b Burn And here at time B: 1 e Uniq 2 a Uniq 3 f Uniq 4 c Uniq 5 a Uniq 6 a Uniq 7 b Uniq 8 e Uniq 9 c Uniq 10 f Uniq 11 a Uniq 12 b Uniq 13 d Burn 14 d Burn 15 b Burn 16 d Burn 17 c Burn 18 c Burn 19 b Burn 20 d Burn 21 e Burn 22 a Burn 23 f Burn 24 b Burn
Regards,
Adi.

In reply to Extensive array compression by adismaug

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.