in reply to Re: ideas on how to improve existing code
in thread ideas on how to improve existing code

Note that this breaks on any CSV data which allows quoted strings with embedded commas.
this,line,has,6,"fields, not",7
Just use Text::Csv and you don't have to worry about things like that.