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 @sorted = sort { $a->{title} eq "THIS BOOK FIRST" && -1 or $b->{title} eq "THIS BOOK FIRST" && 1 or $a->{author} cmp $b->{author} or $a->{title} cmp $b->{title} } @things_to_sort; print Dumper \@sorted;