The first thing I looked for while reading over your code was a line such as use Text::CSV. The simplest way you can achieve what you're after is to process your CSV data using Text::CSV. Not only is it the simplest way, it's also bound to be the most robust and thoroughly tested approach.
Dave
In reply to Re: escaping commas in value when writing to a cvs file
by davido
in thread escaping commas in value when writing to a cvs file
by ibra
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |