in reply to Twisted sort requirements

Working from the first reply, which was a good start, I'm not sure this would qualify as "elegant", but it does what you want:
use strict; use warnings; use Data::Dumper; my @things_to_sort = ( { author => 'bart', title => 'skateboarding' }, { author => 'lisa', title => 'postmodernism' }, { author => 'marge', title => 'hairstyles' }, { author => 'lisa', title => 'THIS BOOK FIRST' }, { author => 'homer', title => 'donuts' }, { author => 'bart', title => 'coolness' } ); my ($first) = grep { $_->{title} eq 'THIS BOOK FIRST' } @things_to_sor +t; my @sorted = sort { $a->{title} cmp $b->{title} } grep { $_->{author} eq $first->{author} } @things_to_sort; push @sorted, sort { $a->{author} cmp $b->{author} or $a->{title} cmp $b->{title +} } grep { $_->{author} ne $first->{author} } @things_to_sort; print Dumper \@sorted;
I couldn't figure out a way to do it all in a single sort block -- especially when it comes to figuring out which author should be listed first. That just seemed to need an extra step at the outset. Maybe there's a way to use just one sort block after grepping for "THIS BOOK FIRST", but I haven't found it...

update: my first posting had a much more complicated block for the first sort -- which was a failed attempt to do everything in one sort -- but I simplified it to just the appropriate logic.