in reply to Re^3: implicit sort disables a chained subroutine?
in thread implicit sort disables a chained subroutine?
An it wouldn't make any difference in your case whether the comparator function were passed to sort as a coderef
Hmm. I thought it would. If first parameter to sort was either a coderef or a string (constant) or bareblock, it would take it as a comparator, but if it is a bareword, then it's a (user or builtin) function that gets called and it results get passed to sort with the default comparator would be used.
That would treat user functions the same as builtins are currently treated as with split in the example I showed.
But you are right, that water passed under the bridge a long time since, and it is not going to change course now.
It surprises me that I never encoutered this before.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: implicit sort disables a chained subroutine?
by demerphq (Chancellor) on Jan 14, 2005 at 09:39 UTC | |
|
Re^5: implicit sort disables a chained subroutine?
by Aristotle (Chancellor) on Jan 14, 2005 at 09:27 UTC |