in reply to Hash ordering

AnomalousMonk already explained the issue, I just wanted to add: what is your goal here? Hashes are by definition unordered, so if you want them to be output in a certain way, you'd have to explain what that is. For example, if you just wanted to output the hash with the keys sorted, one of the most common ways to do so is for my $key (sort keys %hash) { ... }, and then access each value inside the loop via $hash{$key}.