R. Joseph Newton wrote: > Rob Dixon wrote: > > > James Edward Gray II wrote: > > > On Friday, June 6, 2003, at 03:32 AM, R. Joseph Newton wrote: > > > > > > > The player's name IS the number. No other numbering system is > > > > needed. The players name is NEVER stored in the hash, AFAIK. The > > > > name is used to feed a hashing function, which renders an index into > > > > the storage of the hash structure. There is found the count-- the > > > > ONLY DATA stored for any player/number., > > > > > > Well, I think we got Stuart sorted out a few days ago, but since you > > > bring it up I prefer to think of a hashes as stored pairs, no matter > > > what they really are. You could be right about the key not being > > > stored, I honestly have no clue. Things like keys() and each() have to > > > get it from somewhere though (Reversing the hashing operation? Again, > > > no clue.) and since they do exist, it's easier for me to think of them > > > as a key and value pair being stored. Of course, this is all just > > > opinion and I'm sure other programmers have different views from either > > > of us. > > > > To simplify somewhat, the key string is massaged into a numeric value > > called the 'hash value'. This value determines where in the internal > > structure the data element is stored. Each entry consists of three > > items: the hash element's key string and value, and the computed 'hash > > value'. > > > > To locate an element from a given hash key, the 'hash value' is > > calculated, and the area of storage which this indicates is > > searched for an entry with a matching key string. > > > > In short: yes, the hash element does keep a copy of the key string > > internally. > > > > HTH, > > > > Rob > > Hi Rob, > > Thanks for the clarification. I must admit I was a bit over the top in that > statement. I was just trying to break that linkage that the OP seems to see > between the hash and low-level index chasing in arrays. > > It is also good to get confirmation that the Perl hash is indeed a hash in > the general algorithmic sense, also. I must confess that I have been pretty > much just running on that assumption without any firm confirmation of that > from the docs.
Hi Joseph. Mark-Jason Dominus' module FakeHash is quite an education. It implements Perl's internal hash structure in Perl! It has a subclass FakeHash::DrawHash which creates a hash which will draw a picture of its own internal structure. Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]