my $first = "Fool"; my $second = "Foot"; my $diff = ($first ^ $second); print unpack "B*", $diff; # Print the binary representation of the difference my @diff_char = split //, $diff; # get a char by char difference.