in reply to Potentially useful code fragment for you JAPHer's

And for those of you wondering what the easiest other way is
($x, $y) = ($y, $x);
-- Dave

Replies are listed 'Best First'.
Re: Re: Potentially useful code fragment for you JAPHer's
by japhy (Canon) on Mar 20, 2001 at 20:46 UTC
    But the one jcwren posted can be easily abused:
    $==1,$^^=2,$^^^=$=^=$^^^=$=; $==1,$^^=2,$=^=$^^^=$=^=$^^;
    The traditional method (the swap you show) is only easily obfuscated by something like
    # if you're allowed to over-write $( and $) ($),$() = ($(,$));
    Kudos to the person who explains my XOR obfuscation.

    japhy -- Perl and Regex Hacker