open INFILE, "words.txt" or die "can't open file $!"; while ($word = ) { chomp($word); $dict{$word}=1; } while ($word = <>) { chomp($word); @words=split//,$word; if(!exists $dict{$word}) { print "$word is mispelled\n"; } }