foreach $unicode (keys %from) { if (defined($to{$unicode})) { if ($from{$unicode} ne $to{$unicode}) { my $fromchar = $from{$unicode}; my $fromchar =~ s/0x(..)/pack('c',hex($1))/ge; $tochar = $to{$unicode}; $tochar =~ s/0x(..)/pack('c',hex($1))/ge; $wrong = $wrong . $fromchar; $right = $right . $tochar; } } }