If the inner hashes always just have those 3 keys, there's no need for an inner loop:
my $same = 0; if (@AoH_curr == @AoH_prev) { $same = 1; for my $i (0..$#AoH_curr) } my $a = $AoH_curr[$i]; my $b = $AoH_prev[$i]; if ($a->{node} ne $b->{node} || $a->{link} ne $b->{link} || $a->{link} ne $b->{link}) { $same = 0; last; } } }
(Untested).
In reply to Re: Comparing elements in Array of Hashes (AoH)
by moritz
in thread Comparing elements in Array of Hashes (AoH)
by hmadhi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |