> -----Original Message----- > From: Bryan R Harris [mailto:[EMAIL PROTECTED]] > Sent: Monday, June 24, 2002 2:22 PM > To: [EMAIL PROTECTED] > Subject: when to use hashes... > > > > (This is still the beginner's list, right?)
Sure, why not? > > I'm surprised at how often the answer to a question is "You > should be using > a hash, not an array." Usually when the array in question is being searched repeatedly. A hash is designed for rapid retrieval. > So my question is, how many keys is > too many? Is > there a rule of thumb? It isn't the size that matters, it's how you use it :) Use a hash when you want to access data by a key. > (like "if you have over 500,000 > items, use a 2-d > array instead of a hash") Perl doesn't have 2-d arrays. If you have 500,000 of something, that gets in to the realm of "a lot". A database may be the best answer. Or not. It depends... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]