Do you know where your variables are? | |
PerlMonks |
Re^3: To Hash or to Array--Uniqueness is the question.by Nkuvu (Priest) |
on Dec 02, 2005 at 17:10 UTC ( [id://513652]=note: print w/replies, xml ) | Need Help?? |
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
|
|