in reply to Script to find and delete files
See the File::Find module, I believe the doucmentation contains an example which is very similar to your requirements.