Perl help

I am quite new at Perl and I would need some help. I have a csv file which will get created on a monthly basis and have 12 months worth of data in it.

The structure of the csv file is as follows

2014-03,hostname1,10
2014-03,hostname2,20
2014-04,hosname1,15
2014-04,hostname2,23

and so on....
Note: there are more than 2 hostnames I just put 2 for the example

So for every month there will be new entries for the hosts.
I need to populate 2 variables that I need which are used to build an excel sheet.

my $headings = [ 'hostname1', 'hostname2' ];
 my $data = [
        [ '03-2014', '04-2014', '05-2014', '06-2014' ],
        [ 10, 20, 30, 40 ],
        [ 15, 22, 25, 30 ],
        [ 23, 34, 41, 45 ],

So basically here is where I get lost...the data variable will grow as the months progress with the date and the data numbers. The csv file will have a whole years worth of data. I would run this perl script every month after my csv file is generated.

Anyway any help would be great!
Thanks in advance

I suggest you summarize the various CSV files that come in each month, into one large CSV file that is record formatted. I wonder if you will exceed the size of that structure (I did not look up the limits of perl vars). I also don't quite understand the way you are building that structure or how you would extract data from it. It seems the first part is dates, the following parts are numbers. What's wrong with simply concatenating to one large file? What problem are you trying to solve?