in reply to RE: Re: interchanging variables the tough way (BENCHMARK)
in thread interchanging variables the tough way
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: RE: Re: interchanging variables the tough way (BENCHMARK)
by tye (Sage) on Aug 30, 2000 at 21:09 UTC |