input text from file into 2d array

Hi all

I have a little brainscratcher here.

I want to draw a pie chart from data in a text file.

The drawing of the graph works fine, if I insert the data manually into a 2d array.

Now I want to pull the data from a text file (which was created using a uniq -c command) see sample below.

      1 012lg.pwv.gov.za
      1 0zero1.co.za
      1 123websites.co.za
      1 3gi.co.za
      1 3rivers.net
     12 3smedia.co.za
      1 4data.co.za
      3 4seasons4u.co.za
      1 aability.co.za
      2 aapg.org
      1 aapt.net.au

Now the thing that I would like to know. is it possible to change that data into something like a 2d array as seen below

my @data = (['Project', 'HW1', 'HW2', 'HW3', 'MidTerm', 'Final'],
            [25, 6, 7, 2, 25, 35]);

I would prefer if it was in perl, as the graphing is done in perl.

Thank you in advance

my @data = ['Project', 'HW1', 'HW2', 'HW3', 'MidTerm', 'Final'],
            [25, 6, 7, 2, 25, 35];
print $data[0][1] "\n";   # first row second column

creates a matrix - your two D array. IS that what you want?

hi Thank you for your reply. It put me on the right track, and now I have the text file in a matrix(2d array). Regards