# let's assume some values for the sake of discussion $a = 'foo'; $b = 'bar'; $a = $a ^ $b; # $a now contains both variables, $a and $b logical or'ed # together, so at this point a=foo^bar and b=bar $b = $a ^ $b; # logically or-ing them again (since b still contains bar) # returns the original value of a, so now a=foo^bar # and b=foo $a = $a ^ $b; # then we logical-or the combined value with b, which now # contains our original a value. this returns the # original b value, so now a=bar and b=foo