http://www.perlmonks.org?node_id=942334


in reply to search folder and delete certain files with perl

Maybe just use the system tool?

$ find /var/opt/xim/syslogs -maxdepth 1 -type f -name "Syslogd*" -mtim +e +0.5 -delete

(Run without -delete first, to make sure you picked the right files!!)