I am unsure how to compare arrays of hashes ... -- Lady_Aleena

The comment "Data::Compare does have the facility to compare array references" does not apply with respect to the above doubt. With combination of ...

# I have not figured out this part yet. # elsif (ref($old) eq 'ARRAY' && ref($new) eq 'ARRAY') { # }

... it seems you are unsure about comparison of array reference of hash references. (Loose language sinks ships. ;-) Regardless, you would need to loop over array (reference) elements near the beginning of the sub ...

sub deep_data_compare { my ( $old, $new ) = @_; if (ref $old eq 'ARRAY' && ref $new eq 'ARRAY') { # Handle the case of uneven number of elements in # each array reference as you see fit. Here assumption # is that both references have the same number of # elements. for my $ix ( 0 .. $#{ $old } ) { deep_data_compare( map $_->[ $ix ], $old, $new ) } } ... }

In reply to Re^2: Using Data::Compare recursively to better identity differences between hashes by Anonymous Monk
in thread Using Data::Compare recursively to better identity differences between hashes by Lady_Aleena

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.