$a=\$x; $b=\$y; print "$a $b\n" ($a,$b)=($b,$a); print "$a $b\n";
update: changed $a and $b to references.
In reply to Re: How to swap scalar values without copies
by asarih
in thread How to swap scalar values without copies
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |