|
|
| Perl Monk, Perl Meditation | |
| PerlMonks |
Re^3: To Hash or to Array--Uniqueness is the question.by Nkuvu (Priest) |
| on Dec 02, 2005 at 12:10 UTC ( [id://513652]=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.
On the contrary, you're sorting the keys of the hash, but you lost the order of the input. Given the sample data I used in my script (one foo bar one baz two quack baz) the sort method prints out bar, baz, one, quack, foo, two. Of course if one wanted the sorted order then the use of the array is pointless. But if one is looking for the order of the input data, an array (or a module) is, as far as I know, necessary.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||