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