perlguru22 has asked for the wisdom of the Perl Monks concerning the following question:
The problem that I am having is that my text.txt file contains something like this. Ex more cat lose pat red persan when I run the program it prints them together like more cat lose is mispelled instead of breaking them apart. Thanks, any help or advice would be useful =)open INFILE, "words.txt" or die "can't open file $!"; while ($word = <INFILE>) { chomp($word); $dict{$word}=1; } while ($word = <>) { chomp($word); @words=split//,$word; if(!exists $dict{$word}) { print "$word is mispelled\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Reading Files
by Kenosis (Priest) on Nov 02, 2012 at 06:11 UTC | |
|
Re: Reading Files
by kielstirling (Scribe) on Nov 02, 2012 at 05:46 UTC | |
by perlguru22 (Acolyte) on Nov 02, 2012 at 05:50 UTC | |
by kielstirling (Scribe) on Nov 02, 2012 at 05:55 UTC | |
by 2teez (Vicar) on Nov 02, 2012 at 05:57 UTC | |
|
Dictionary load improvement
by space_monk (Chaplain) on Nov 02, 2012 at 17:36 UTC |