in reply to Why do we need $a and $b to be special?
In a module of mine (might event release it at some time), I needed the same functionality, so I wrote:
my $caller=(caller(1))[0]; no strict 'refs'; @out=sort { local (${"${caller}::a"},${"${caller}::b"})=($a,$b); $sort->($a,$b) } @in;
This might not give the fastest runtimes, but allows the user to pass a compare sub that works in any of the two ways.
-- dakkar - Mobilis in mobile
Most of my code is tested...
In Section
Meditations