I may be misunderstanding you, but if I guess right you want to READ every line in the text-files (which are like some sort of log-files it seems), extract the date in each of these lines, compare that date to today's date and if older than 1 month, delete that line in the file and save it in some archive file.
For date parsing and comparisons have a look at Date::Manip which is the Rolls Royce of date-modules, what it lacks in raw speed, it delivers in convenience.
Generally, you could do as follows:
- open your archive file for adding to it
- open the first of your files for reading
- read this file line by line
- check the date in each line and if older than one month write it to the archive file, else push it onto a stack for temporary storage
- At the end of the file; close it and reopen it for writing (this will clear the contents of this file!); else goto step 3
- now write your temporary stack to this file (hint: use foreach)
- close the file
- open your next file; if no more files remain: close your archive file; else goto step 3
CountZero
"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law