Rule 1: don't parse CSV yourself
Use Text::CSV and/or Text::CSV_XS instead.
In reply to Re: Parsing output from the CSV file by Tux in thread Parsing output from the CSV file by kar_333