#! perl -slw use strict; use threads; my @words = do{ local( @ARGV, $/ ) = 'your.dictionary'; <> }; chomp @words; my %dict; undef @dict{ @words }; my $errors = 0; my $savedfh; my @files = glob "*"; open $savedfh, '<', shift( @files ) or die $!; for my $file ( @files ) { my $fh = $savedfh; my $thread = async{ open my $fh, '<', $file or die $!; $fh }; map +( exists $dict{$_} || ++$errors ), split while <$fh>; $savedfh = $thread->join; } print $errors;