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:
$dataPos{"POSITION NAME"} = 9;
A little further in your list you'll see "POSITION NAME" at position fifteen; the assignment statement for this would look something like
$dataPos{"POSITION NAME"} = 15;
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.
hth.
-hershmaster
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.