|There's more than one way to do things|
Re: hash and array mismatchby Anonymous Monk
|on May 09, 2007 at 19:09 UTC||Need Help??|
The keys corresponding to 9-13 were repeated later in your $line, which resulted in an overwrite of the values corresponding to those keys.
For example, from the first set of print statements, position 9 corresponds to "POSITION NAME", which would look something like:
A little further in your list you'll see "POSITION NAME" at position fifteen; the assignment statement for this would look something like
Since this statement is executed after the first, your 9 disappears, and only 15 is stored as the value for the key of "POSITION NAME".
Repeat the above for entries 10-13, and you should see those values got overwritten.
If you want to keep all this data, you might consider making the integers your keys, and saving the text as the values. Of course, you already did that when you created the @data array.