Created
January 1, 2020 16:15
-
-
Save thundergnat/fadc9a77b9e53d308f13ec0945c43687 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $id = 1; | |
my %customer = ( | |
$id++ => { :name('aa') :age(9) }, | |
$id++ => { :name('bb') :age(22) }, | |
$id++ => { :name('cc') :age(11) }, | |
); | |
say 'Sorted by age, descending:'; | |
say "ID# {.key}) Name: {.value<name>}, Age: {.value<age>}" | |
for %customer.sort( -*.value<age> ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment