Matt Sergeant wrote: > On 31 Oct 2005, at 12:51, [EMAIL PROTECTED] wrote: > >> + '<=>' => \&spaceship, > > Is this wise? cmp yes, but spaceship? >
It doesn't cost us anything; I just put it in for coverage. I've made it a practice to overload both 'cmp' and '<=>' with the same sub for objects in the past, whether or not the object represents something that is "numberlike" or "stringlike" so that it is impossible to use the wrong operator. In reality, we only need to overload 'eq' and 'ne' but I find the flexibility of 'cmp' to be really tempting. Actually, it just occurred to me that by changing the code slightly, I can kill two birds with one stone, making it trivial to sort recipients by domain. I guess I'll just remove the '<=>' binding and rename the sub to addr_cmp instead. See what you think of the next commit... John
