in reply to Re: comparing key-value pairs of two hashes
in thread comparing key-value pairs of two hashes
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;
|
|---|