Just to add some more perl to this thread, check out the CPAN modules Search::InvertedIndex and DBIx::FullTextSearch. Modules such as these can make up the bones of a search mechanism for a wiki or a content management system, where the pages are stored in a relational database.