my $cwd = getcwd(); my %seen; find(sub { push @headers , $_=~ /\*\.h/ if -f $File::Find::name && !$seen{$_}++; }, $cwd);