News You Can Bruise for 1999 June 11

Permalink [No comments] :

It is Fun With Perl... yeah!

$a^=$b^=$a^=$b

I thought it was impossible to swap two variables without using a third variable, but there it is. I forgot who posted this to the Fun With Perl list, but I am eternally grateful to them.

Permalink [No comments] :

You could make the case that that implicitly uses a third storage space to store the results of the xors before it is put into one of the variables, but even if that does happen, you could design a computer that didn't do that.

I feel like a new xor!