my @ar = $t1 =~ /(..)/g;
$foo->delete("1.0","end");
foreach (@ar) {
$foo->insert("1.0",chr(pack("H*",$_)));
}
####
$txt3->delete("1.0","end");
my $hexor = unpack('h*',pack('h*',$t1) ^ pack('h*',$t2));
$txt3->insert("1.0",$hexor);
####
my $hhh = unpack('h*',pack('h*',"20") ^ pack('h*',"61")); #xor ' ' and 'a' should result in 'A'
print unpack('h*',$hhh);
####
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","~");
}
}
}