I think that what the book implies is that if the type of $a and $b are of a similar type as a scalar (or untyped), and not necessary a number or string, you have to use a temporary variables to swap as all your methods above use some assumed property of the data type to make the swap "more efficient". I would still think that the
($a,$b)=($b,$a) is going to be near optimal for any data type, and will be the optimal one when the type of $a and $b is not preset or may be different.
Dr. Michael K. Neylon - mneylon-pm@masemware.com
||
"You've left the lens cap of your mind on again, Pinky" - The Brain