I have a directory of log files - audit_20121101_010000.csv (nov 1st), audit_20121102_010000.csv (nov 2nd), audit_20121103_010000.csv (nov 3rd), audit_20121104_010000.csv (nov 4th) etc. generated on a daily basis (windows box). I am very new to perl and would like to compare the most recent file with the second most recent file on a daily basis and saved it to a third file (daily basis). I am only interested in comparing the two most recent files. I can delete older files, if necessary. I was wondering if someone can help me out please.
Example
(most recent file) - audit_20121104_010000.csv (nov 4th) contains
nov1 bobjoe mary <new line>
nov2 maryty <new line>
nov3 joe doe
(second most recent file) - audit_20121103_010000.csv (nov 3rd) contains
nov1 bobjoe mary <new line>
nov2 maryty <new line>
The difference would be:
nov3 joe doe