Skip to content

Instantly share code, notes, and snippets.

@angch
Created September 5, 2016 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angch/52810c746a21cb726ba32ce5df072988 to your computer and use it in GitHub Desktop.
Save angch/52810c746a21cb726ba32ce5df072988 to your computer and use it in GitHub Desktop.
use v6;
my $employees = [
{firstname=>'Joe', lastname=>'Bloggs', grade=>3},
{firstname=>'Ola', lastname=>'Nordmann', grade=>3},
{firstname=>'Kari', lastname=>'Nordmann', grade=>2},
{firstname=>'Jane', lastname=>'Doe', grade=>4},
{firstname=>'John', lastname=>'Doe', grade=>3},
];
say (
$employees.sort: {-$^a{'grade'}, $^a{'lastname'}, $^a{'firstname'}}
).perl;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment