"R. Joseph Newton" wrote:
> Stuart White wrote:
>
> > This does make it clearer, but not entirely. Is this
> > what is happening: the loop starts, and goes
> > immediately into the if statement. when the regex
> > finds a line with "Jump Shot" it stores that in $2,
> > and the player name in $1. The next thing it does,
> > and I'm not quite sure how, is it populates a hash.
> > Creating it I understand, populating it not so much.
> > Maybe if I write it as $linehash{$1} =
> > $linehash{$1}++; though, that still doesn't clear up
> > the populating part.
>
> The player's name IS the number. No other numbering system is
> needed. The players name is NEVER stored in the hash, AFAIK.
Sorry. I let hyperbole take over here--or poetic license perhaps..
Obviously, the keys are stored in or with the hash, or there would be no
ready way to generate the keys(%hash) array.
The point here is that the essential purpose of the key is that of a
pointer, rather thanas data in itself. Although the strings used keys
can be input and output like any other data, they are more akin in
nature to well-chosen variable names, which likewise have plain-language
meanings that shed light on the purpose or significance of their
payloads. You could even look at a hash as a structure which supports
the ad-hoc creation of meaningful varaible names.
Joseph
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]