The recent addition of the list_of_objects.sort('method_name') syntax
is really useful, particularly for Class::DBI-based applications. But
I'm now trying to work out how to extend this to deal with more distant
relationships - i.e. sorting on a method in a related class.Let's say we have a setup where we have a Message object with a related Sender object with a 'name' method on it. message.sort(sender) won't work as that will be a the Sender object itself, so I'd like to be able to do something like: messages.sort(sender.name) I've gotten around this in a few places by overloading stringification on the Sender class, but this won't work if there are a variety of fields I'd want to be able to sort by, where I'm left with having to add a 'shortcut' sendername method into the class that just calls $self->sender->name. I've tried adding my own local 'objsort' virtual method, but haven't really gotten very far with this approach yet.. Is there something we can do to extend the syntax of sort even further? Or is there a better approach to this? Thanks, Tony
