in reply to Read the csv file to a hash....
Take a look at Text::CSV_XS. Things should be fairly obvious from that point on (hint: to add an element to an array reference you can use
)