title: Check for CSV file correctness in Perl
body: <p>I have a process that reads a CSV file, and I want to make sure it's correct before I start parsing it.</p>
  
  <p>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</p>
  
  <p>Is there a way to check that the file is proper CSV file? I am using <a href="https://metacpan.org/module/Text%3a%3aCSV_XS" rel="nofollow"><code>Text::CSV_XS</code></a> to parse it.</p>
  
  <hr>
  
  <p>Googling a bit I found <a href="http://repo.or.cz/w/Text-CSV_XS.git/blob/HEAD:/examples/csv-check" rel="nofollow">this csv-check example code</a> on the <code>Text::CSV_XS</code> Git repo. It looks like something I could use.</p>