in reply to speedier text matching
You're iterating through the wordlist too many times, giving you O(N**2) scaling, or worse. Try making your wordlist the keys to a hash, which will speed lookups a lot. Something like this,
my %word; { open my $fh, '<', '/path/to/wordlist.txt' or die $!; chomp( my @words = <$fh>); close $fh or die $!; @word{@words} = (); } # ... then when it's time to look up a word, if (exists $word{$foo}) { # ... }
After Compline,
Zaxo
|
|---|