Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/env raku
- my %hash =
- (
- '40:A_B' => 1,
- '22:jfdks' => 1,
- '3:fjdksf' => 1,
- '8:Q_Z' => 1,
- '2:interview' => 1
- );
- for %hash.keys -> $k {
- say 'k: ',$k;
- }
- say '---------- Sorted ---------------';
- for %hash.keys.sort({$^a.split(':').head.Int <=> $^b.split(':').head.Int}) -> $k {
- say 'k: ', $k;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement