use File::Find; find sub { if(-f) { system("grep 'theInfoLookingFor' $_ >$_.out"); } }, $rootdir;