in reply to Putting all the files in an array

use File::Find::Rule my @headers = File::Find::Rule->file->name('*.h')->in($cwd);