I'm new to PERL (i started reading my first tutorial yesterday afternoon :)), and this is what i'd like to do (i've been looking everywhere for similar examples but cant quite find it)

I'd like to take a comma de-limited text file and make each line in the text file it's own array with the first item in each array the name of the array (at least thats how I think it should be done). However the first item in the line isn't always unique and the same number of items aren't in every line (some line may have 3, others 6). The good thing is that there are only 6 possible things the first item in each line could be.
ex. Andrea, 6, good, nice, 3 Bill, 5, 4, better, 5, 7, 4 Clark, 4, 5 Dave, best, better, best Joe, 5, 0 Joe, 4, 6 William, 6, 7, 8, 3 , 1 ,5 Andrea, 45, bettr, best, 6 where the result I would like is a matrice ex. Andrea(1, 2)=good Dave(1,2) = better Joe(1,2) = 0
where the first subscript is the nth number of the same thing and the second is the item number in the array. Can you help me in figuring out how to do this/give me suggestions. THanks!!!

BTW, I hope i'm not asking for too much :)

In reply to Making an array out of each line of a text file by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.