my ($x,$y)=(1,2); #one line, SLOW ($x,$y)=($y,$x); #three lines. fast. my $tmp=$x; $x=$y; $y=$tmp;