I have a process that reads a CSV file, and I want to make sure it's correct before I start parsing it.

I get a file name, check if it exists, then check its integrity. If it's not there or not a proper CSV file then I try the file from the previous day instead

Is there a way to check that the file is proper CSV file? I am using [`Text::CSV_XS`](https://metacpan.org/module/Text%3a%3aCSV_XS) to parse it.

---

Googling a bit I found [this csv-check example code](http://repo.or.cz/w/Text-CSV_XS.git/blob/HEAD:/examples/csv-check) on the `Text::CSV_XS` Git repo. It looks like something I could use.