sub parse () { my $t1 = $txt1->Contents(); my $t2 = $txt2->Contents(); chomp($t1); chomp($t2); $txt3->delete("1.0","end"); my $hexor = unpack('h*',pack('h*',$t1) ^ pack('h*',$t2)); $txt3->insert("1.0",$hexor); my @ar = $hexor =~ /(..)/g; $txt33->delete("1.0","end"); foreach (@ar) { if (chr(hex($_)) =~ /[a-zA-Z]/) { $txt33->insert("end",chr(hex($_))); } else { $txt33->insert("end","~"); } } }