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_sort; 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;