Have you seen salva's Sort::Key and Sort::Key::Maker - they don't do exactly what you're talking about, but I'm fairly sure you'll find something to like in them.
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
Comment on Re: Comparing spaceships (cmp and <=> as options)