http://www.perlmonks.org?node_id=11348


in reply to diff of two hashes.

i would do something like this, where %a and %b are the hashes to compare:
foreach (sort keys %{{%a, %b}}) { if (!exists($b{$_})) { print "$_ only in a\n" } elsif (!exists($a{$_})) { print "$_ only in b\n" } elsif ($a{$_} ne $b{$_}) { print "$_: values in a and b differ\n" + } }
sc