Wow that's great code except the definition of $date_qr = qr line... The extra space lost me an hour or two this morning. I'm not sure why that made a difference. There is a space after the .\d{3} in the input files. Any ideas?
Works like a charm besides that!
Comment on Re^8: Time matching YYYY-MM-DD HH:MM:SS.SSS
The regex I used works against the sample data you supplied. Perhaps your real data is different. Perhaps you have tabs rather than spaces (so use \s), or perhaps some lines don't have any text after the timestamp?