|
You cannot "keep" a hash sorted, it's simply not how hashes work.
Do what you did w/ array storing the keys. Then foreach that array when you want to perform an ordered operation on the hash. Depending on the application of course there are better ways, but considering what posts you've made on the subject this should be fine. Arrays will keep their order of course.
Just do something like..
foreach my $key (@keys) {
my $value=$hash{$key};
print "key $key - value $value\n";
...
}
Shrug..
|