Just another Perl shrine | |
PerlMonks |
Sorting hashes with new value detectionby sulfericacid (Deacon) |
on Jan 24, 2006 at 17:39 UTC ( [id://525255]=perlquestion: print w/replies, xml ) | Need Help?? |
sulfericacid has asked for the wisdom of the Perl Monks concerning the following question:
I have a hash that has numeric values. I need to be able to sort out these values and print a header for each NEW value.
To yield: Kutsu tried to help with the code on his pad. The idea was to use HOA or AOAs and I haven't any experience with those (or references) so I'm kind of lost. What I have to play with is Which works. The problem I am having is trying to figure out how this would work with dynamic data. I'll never know what "levels" exist or how many there are, so using indexes probably won't work properly. In the end, I need to be able to sort and rip parts and pieces of this with ease (like a typical hash). Things to keep in mind are; I need to be able to sort by length of characters in the words, and find specific elements which words start with (or end with) specific characters. Ideally, it'd need to be as maintainable as a hash which I'm sure HOAs and AOAs are capable of. I'm just new to the multidimensional world and could use some insight. "Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us" sulfericacid
Back to
Seekers of Perl Wisdom
|
|