Skip to content

Instantly share code, notes, and snippets.

@esobchenko
Forked from anonymous/gist:4275855
Created December 13, 2012 11:35
Show Gist options
  • Save esobchenko/4275872 to your computer and use it in GitHub Desktop.
Save esobchenko/4275872 to your computer and use it in GitHub Desktop.
my $sorted_results = [
sort
{
( $a, $b ) = ( $b, $a ) if $order eq 'desc';
$a->{$sortby} <=> $b->{$sortby} || $a->{$sortby} cmp $b->{$sortby}
} @$results
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment