There are modules, such as the File::Find module, that can do just that for you, all you need to do is to pass it the relevant callback subroutine that will check the age of each file using stat or one the -M -A -C file test operators.
Comment on Re: Find -mtime or -ctime from a Find module?