my %nums = ( four => 4, one => 1, three => 3, two => 2, ); for %nums.pairs.sort: { $^a.value <=> $^b.value } -> $pair { say $pair; }