Alles in Ordnung
Perl returns its hash values in a random order. Since 5.14 or so, the random order changes every time. So if you loop over your hash values, you get a different ordering each time.
for my $k (keys %hash) { }
No problem you say, I'll use sort to order my keys.
for my $k (sort keys %hash) { }
But what if you want to use a non-default order, like case-insensitive? Easy-peasy you claim.
for my $k (sort {uc ($a) cmp uc ($b)} keys %hash) { }
Now here's my problem. I'm using XS to loop through the hash, and I want to sort the keys in the hash according to the user's preference.
