|
|
| Problems? Is your data what you think it is? | |
| PerlMonks |
Re^3: Sorting Datesby secret (Beadle) |
| on Nov 24, 2005 at 06:17 UTC ( [id://511407]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
>Does that sort the hash too You cannot sort a hash : a hash is by construction with no particular order. What you can do is sort the keys of a hash and print the corresponding values. When you do foreach (keys %hash) you get the keys in an order that is undefined although always the same. But it will change if you add or remove keys, therefore if you need a specific order you should do foreach ( sort { my sort function} keys %hash )
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||