in reply to interchanging variables the tough way

Yeah, delving back into my old days with assembler, you can do it using xor:
$a = $a ^ $b; $b = $a ^ $b; $a = $a ^ $b;
This swaps 2 variables without using a temporary, simply do it twice to swap three, e.g:
$a = $a ^ $b; $b = $a ^ $b; $a = $a ^ $b; $b = $b ^ $c; $c = $b ^ $c; $b = $b ^ $c;
Hope this helps ;-)