in reply to Matching two files real time

There's a CPAN module that might be of value: CHI-0.49. I haven't used it myself, but I was directed to it by the maintainer of a different caching module (Tie-Cache-LRU-20110205). The fact that it supports time-based expiration seems to match nicely with your problem.