good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Just a quick question for the Perlmonks.
I have a hash, with keys being month names and values being number of days in the month. If I want to print the keys out in a *non-alphabetical* order (if I sort them then I get "April", "August", "December", "February" etc.) particularly the order in which they come in - (Jan to Dec) how can I do this? Or am I going to end up with another hash holding the month, and an integer representation to refer to in the sort? I know hash entries are effectively random when set up based on memory location, but there must be some trick to ordering the hash keys as I wish.. I had a look at Date::* but nothing lept out at me Many thanks
Bukowski - aka Dan (dcs@black.hole-in-the.net) In reply to Sorting hash keys according to different criteria by Bukowski
|
|