http://qs321.pair.com?node_id=381295


in reply to using a subroutine

Perl is a great language, but sometimes the system utilities are a better tool, e.g. (untested):
find /lib -name 'core.*' -exec rm -f {} \;