in reply to Re: comparing key-value pairs of two hashes
in thread comparing key-value pairs of two hashes

For those working on their golf (or who just like some of the fun things that Perl can do), here's your exact code in 3 (Perl) lines.
my (@only_in_foo, @kv_different, @kv_equal); push( @{ exists $bar{$_} ? $bar{$_} eq $foo{$_} ? \@kv_equal : \@kv_different : \@only_in_foo}, $_) for keys %foo; my @only_in_bar = grep { ! exists $foo{$_} } keys %bar;
Ivan Heffner
Sr. Software Engineer, DAS Lead
WhitePages.com, Inc.