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