@files = glob "*"; foreach $file (@files) { open(INPUT, $file); while() { @line = split(/ /); foreach (@line){ $errors++ unless $d{$_}; } } close(INPUT); }