in reply to Sort of basic search engine/pattern matching problems

If I understood your problem, the best solution is to read the dictionary file into a hash once, and then read the query file line by line, looking into the dictionary hash each time.

There are plenty of examples for doing stuff like that on this site; I hope Super Search finds some of them.

Perl 6 - links to (nearly) everything that is Perl 6.
  • Comment on Re: Sort of basic search engine/pattern matching problems