>>      ($a ^ $b) =~ /^(\0*)/ && length $1
>
>Whether they give the same value depends on the values of $a and $b.  Try
>it with $a = 'abcdef' and $b = 'abCdef', for example.

To work with any $a and $b, you should play it safe and say: "$a"^"$b".
Otherwise the used-in-numeric-context gremlins will eat your code.

Reply via email to