Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Comparing elements in Array of Hashes (AoH)

by moritz (Cardinal)
on Jul 18, 2012 at 14:14 UTC ( #982438=note: print w/replies, xml ) Need Help??

in reply to Comparing elements in Array of Hashes (AoH)

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; } } }


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://982438]
[james28909]: how come it is so easy for me to not care what others think while others will mute themselves because they are scare they will be called ignorant or stupid
[james28909]: do you relize how shrodinger felt when he was describing the quantum world? what about neils bohr?

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (10)
As of 2017-12-15 14:23 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (433 votes). Check out past polls.