Skip to content

Commit f914072

Browse files
committed
[cookbook] sorting output for consistency between runs
1 parent b9b413d commit f914072

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

categories/cookbook/05hashes/05-05traversing.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
'three' => 'trois'
1717
);
1818

19-
for %hash.kv -> $key, $value {
19+
for %hash.sort(*.key)>>.kv -> ($key, $value) {
2020
say "The word '$key' is '$value' in French.";
2121
}
2222

23-
for %hash.keys -> $key {
23+
for %hash.keys.sort -> $key {
2424
say "$key => %hash{$key}";
2525
}
2626

27-
for %hash {
27+
for %hash.sort {
2828
.say;
2929
}
3030

0 commit comments

Comments
 (0)