Skip to content

Instantly share code, notes, and snippets.

@samcv
Created January 31, 2017 08:42
Show Gist options
  • Save samcv/b34f9f7a9a5ee6c9b6da7b56cae47b3d to your computer and use it in GitHub Desktop.
Save samcv/b34f9f7a9a5ee6c9b6da7b56cae47b3d to your computer and use it in GitHub Desktop.
my %results;
for ^10 {
%results{$_}<bytes> = (1..10).pick;
}
say %results.perl;
say %results.keys.sort({
my $c = %results{$^a}<bytes> cmp %results{$^b}<bytes>;
if $c {
$c;
}
else {
$^a.Int cmp $^b.Int;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment