in reply to just how special are $a and $b these days?

perldoc -f sort has a vast amount of information on writing sort subroutines.

But if all you want to do is use a function from some random module to do the comparison, how about ...

@output = sort { Some::Module::comparison($a, $b) }  @input

Replies are listed 'Best First'.
Re^2: just how special are $a and $b these days?
by DStaal (Chaplain) on Mar 04, 2010 at 13:52 UTC

    Or, if you really want to, you can overload cmp as a call to Some::Module::comparison, and then as long as $a and $b are objects of that module, they'll sort automatically.