in reply to Re^4: Printing hash key shows obscure values - can this be trimmed/removed?
in thread Printing hash key shows obscure values - can this be trimmed/removed?

Still not sure what you are looking for...

use strict; use warnings; my %hBase = ( 'a;a' => 1, 'b;b' => 2, 'c;c' => 3 ); my %hPost = ( 'a;a' => 1, 'b;b' => 3, 'd;d' => 4 ); my %allKeys = map {$_=>1} keys %hBase, keys %hPost; for my $key (keys %allKeys) { if( exists $hBase{$key} and exists $hPost{$key} ) { if( $hBase{$key} eq $hPost{$key} ) { print "$key in both hashes with same value $hBase{$key}\n"; } else { print "$key in both hashes with different values $hBase{$key} != + $hPost{$key}\n"; } } else { print "$key in %hBase with value $hBase{$key}\n" if exists $hBase{ +$key}; print "$key in %hPost with value $hPost{$key}\n" if exists $hPost{ +$key}; } }
  • Comment on Re^5: Printing hash key shows obscure values - can this be trimmed/removed?
  • Download Code