in reply to CSV SPLIT

Serene, Text::CSV is simply the first step:   the one that will effortlessly and correctly (let you) deal with niggling details such as commas within your comma-separated values.   It will correctly produce a Perl data structure corresponding to it.

Baby steps first.   Find examples of Text::CSV and Data::Dumper.   Complete your program to the point where it successfully parses your CSV file and then dumps a correct data-structure so that you can look at it.   That is step one.   Cross that bridge, and prove that you have crossed it.   Next, deal with the separate issue of transforming that data structure into the output that you need.