I'm not sure I understand what you mean. The variables
being swapped are created beforehand in both methods. In
the first examples, they are separate variables. In my
second example, they are members of an array. Each of the
subs swap the values in two variables.
I mainly included them to point out:
- TMTOWTDI
- My benchmarks show arrays are even slower than the
lists in the first example.
:-)
Russ
Brainbench 'Most Valuable Professional' for Perl | [reply] |
I was saying that if you were using them as examples of putting the variables in the array and swapping them, well, for one, that doesn't switch the variables, just the elements of the array; and two, your test should've included the process of forming the array. But nevermind.
$_="goto+F.print+chop;\n=yhpaj";F1:eval
| [reply] |