title: Perl - Sorting Files having date value in filename
body: <p>I have a list of files in the directory for which I want to perform sort and get the latest file. I don't want to do it using latest modification time or created time. I want to sort based on the file name.</p>
  
  <p>The File name will be in the format <strong>DEV_TEST_DDMMYYYYHH24MISS.csv</strong></p>
  
  <p>I need to write a perl script which will read the files from the directory and perform sorting based on the file name.</p>
  
  <p>EX. File names:</p>
  
  <pre><code>DEV_TEST_24032015121022.csv 
  DEV_TEST_04052015074942.csv 
  DEV_TEST_12052015074942.csv 
  DEV_TEST_05052015115948.csv
  DEV_TEST_12022015115948.csv
  </code></pre>
  
  <p>The script should return <code>DEV_TEST_12052015074942.csv</code> as the latest file.</p>
  
  <p>Can someone suggest a better approach?</p>
  
  <p>It is enough if someone can provide sorting logic.</p>