my $file_regex = join( '|', @a ); my @found = grep /^(?:$file_regex)\./, `find . -print`;