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!