in reply to diff of two hashes.
for $x (keys %one) { delete $one{$x} if $two{$x} eq $one{$x}; } ## Show non-matching keys: for $x (keys %one) { print "$x ($one{$x})\n"; }
It destroys the hash, and does not check for keys that are in two but not one. For that, perhaps something like this:
for $x (keys %one) { print "DIFF: $x\n" if $one{$x} ne $two{$x}; } for $x (keys %two) { print "DIFF2: $x\n" unless $one{$x}; }
|
|---|