I was writing a script to modify .CSV files (ClearQuest export results), and it was incredibly complex due to having multi-line fields (“embedded newlines” in CSV jargon).
After some struggling, I came across a built-in module (at least in ActivePerl 5.12.3) called Text::CSV_XS which basically does everything I wanted. I was able to cut my script length by about 60% and get better performance and (seemingly) bug-free results.
This module is easy to use and has good documentation.
Lesson learnt: re-inventing the wheel is not always the best course of action…