in reply to Flying Obfu

Swaps a with b. An old assembly idiom... ^= will also get what you want... =)

Update: used to be common... when i learnt assembly no teacher knew it. I found that in some perl tut actually, which i skimmed for a friend. It discussed something along "while that trick may have been common for swapping registers in assembly, in perl you can do ($a,$b) = ($b, $a) instead.

-nuffin
zz zZ Z Z #!perl

Replies are listed 'Best First'.
Re: Re: Flying Obfu
by awkmonk (Monk) on Apr 09, 2003 at 16:23 UTC

    Oops. I didn't realise it was a common assembly trick, or I wouldn't have posted it.

    Still for none assembly people it can be fun to work out how it does it (preferably on paper, and after a couple of pints).

    Thanks for pointing it out.


    'I think the problem lies in the fact that your data doesn't fit my program'.