outputsub xor { $a = "$a" ^ "$b"; $b = "$a" ^ "$b"; $a = "$a" ^ "$b"; } $a=999999999999; $b=8888888; print "BEFORE: A=$a B=$b\n"; &xor(); print "AFTER: A=$a B=$b\n\n";
BEFORE: A=999999999999 B=8888888 AFTER: A=8888888 B=999999999999
In reply to RE: RE: Re: interchanging variables the tough way (BENCHMARK)
by lhoward
in thread interchanging variables the tough way
by ANKUR
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |