in reply to CSV and regular expressions

To be honest, I'd use something like DBD::CSV for this.

One reason is to let someone else handle it for me, and the other reason is that anything that's in a CSV file today makes a perfect candidate to moving to an RDBMS later. It may be a bit slow, but I'll take slow and correct over fast and 7 headers any day of the week :-)