On Thu, 17 Aug 2000 07:44:03 +1000, Jeremy Howard wrote:
>> $a and $b were done for speed: quicker to set up those global
>> variables than to pass values through the stack.
>The solution is to pass args in as $_[0] and $_[1].
Even if you succeed in making access to @_ as fast as access to $a and
$b (i.e. ignore the stack setup time), access to $_[0] will still be
slower than to $a because of the array index.
Or are you saying that the compiler should optimize and treat "$_[0]" as
a whole?
Still,
sort { $_[0] <=> $_[1] } @list
is very ugly.
I *like* the syntax of
sort { $a <=> $b } @list
Very neat: it *looks* simple. Very Perlish, too: a custom syntax for a
custom application of a function.
If you insist on not using $a and $b in
sub customsort {
....
}
sort \&customsort @list
well, I could live with that. Does that solve your "strict" problem?
p.s. I can't see how this still relates to the subject line.
--
Bart.