Skip to content

Instantly share code, notes, and snippets.

@MikeRalphson
Created May 29, 2009 08:40
Show Gist options
  • Save MikeRalphson/119855 to your computer and use it in GitHub Desktop.
Save MikeRalphson/119855 to your computer and use it in GitHub Desktop.
if ($oi->{'type'} eq 'str') {
@projects = sort {$a->{$oi->{'key'}} cmp $b->{$oi->{'key'}}} @projects;
} else {
#@projects = sort {$a->{$oi->{'key'}} <=> $b->{$oi->{'key'}}} @projects;
@projects = sort {!$a->{$oi->{'key'}} ? 1 : !$b->{$oi->{'key'}} ? -1 : $a->{$oi->{'key'}} <=> $b->{$oi->{'key'}}} @projects;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment