I don't know if you're determined to use Perl or not to do this, but the Unix command 'find' will allow you to specify a number of days since create date or last access date. Pipe the output to 'xargs', and use 'rm'. Something like this:
find -ctime +14 | xargs -f rm
This should find all files created more than 14 days ago, and delete them. You could put this in a daily cron job, and it'll all happen for you.
Update: Don't do this! As
merlyn points out in a following reply, this is a security risk. I'm a casual Unix user, and while I knew that filenames could contain odd characters, I didn't realize the implication of newlines in a file name. See below for more details.
--Chris
e-mail jcwren