I have no doubt that there are modules that do this (Perhaps Text::Ispell or Lingua::Ispell?), but for a quick 1 minute inefficient version, try:
$dictfile="/some/path/to/dictfile";
#Dictfile should have a all words (or regex for words), one per line
open (DICT, $dictfile) or die "Can't open $dictfile:$!";
while(<DICT>){
$words{lc($_)}=1; #using hash as cheap lookup
#Note that a "real" dictionary file will nail you on efficency her
+e. Perhaps a Dbm would be better?
}
while(<>){
foreach $word (split($_)){
if (!defined($words{lc($word)})){
print "$.:$word?\n";
}
}
}
(Now the perl wizards will trounce this code, but I'll post it anyways in hopes of learning from them.)