Hello all,
I'm trying to compare two hashes and arrays. I didn't find any problem when comparing with hashes where in keys are in whatever order.
I accept that my understanding is wrong and certainly it should not match. But still want to match the arrays where data is same in both array's but order varies
use strict;
use Data::Compare;
my $h1 = { 'recid2' => '345', 'recid1' => '123' };
my $h2 = { 'recid1' => '123', 'recid2' => '345' };
my @a1 = (1,2,3);
my @a2 = (3,2,1);
# simple procedural interface
print 'structures of $h1 and $h2 are ',
Compare($h1, $h2) ? "" : "not ", "identical.\n";
# simple procedural interface
print 'structures of $a1 and $a2 are ',
Compare(\@a1, \@a2) ? "" : "not ", "identical.\n";
Any suggestions please