find /foo/bar -mtime +7 -exec rm -rf {} \; #### use File::Find; find(\&wanted, '/foo/bar'); sub wanted { unlink $_ if -M $_ > 7; }