in reply to Deleting by Age!

sort it by age, reverse it, and shift the first filename from the array, then unlink it.

If you are doing a stat and you have a ton of files, consider first getting all the stat into into a hash for all the files, then sorting, otherwise your sort will be running multiple stat for each file. Which is slow on a ton of files.