Review: Perlfect Search | WebReference

Review: Perlfect Search

Review: Perlfect Search

By Lee Underwood

When designing Web sites, one of the goals is to provide effective navigation to aid visitors in finding what they want. Sometimes this means creating a basic menu; other times it involves more sophisticated methods.

One method that's been used effectively is a site map. These can be helpful when you're looking for a specific section of a Web site or a certain category of documents. But site maps aren't very useful if you don't know where to look. This is particularly true if you are trying to find information within a large number of documents.

Many Web sites today include an internal search engine. This helps the visitor find what they are looking for without having to go through the entire site, especially if they don't know the title of the document. Internal search engines provide a convenient way for your visitors to locate articles by using words that are familiar to them.

The methods available for creating an internal search engine include writing a search script from scratch, using an existing search engine modified for a local search, or using an existing script.

Google, for instance, offers several ways of adding an internal search form to your Web site.

You could also write your own search script from scratch but why reinvent the wheel? There are plenty of existing scripts that will work fine in most cases.

One Solution

One of those scripts is Perlfect Search by Perlfect Solutions.

Perlfect Search is written in Perl and developed under an open source license (GPL). That means the script is free. It also means that you are free to make any changes to the source code, as you wish. All that is required to use the script is a Web server on which you are able to execute CGI scripts and Perl 5.004 or higher. The DB_File 1.72 module is also required but it may already be installed on your system. Since it's written in Perl, the script can be used on either Linux/Unix or Windows (running ActivateState Perl).

If you have a large Web site, this script should be able to handle it. The current version (3.31) is able to index 2,000+ documents easily. The FAQ states that the script has a search limit of 65,535 files but that "can be worked around if necessary."

The Two Main Files

Perlfect Search uses two scripts to run the internal search engine. The indexer automatically scans and indexes the documents, using the words from the <title> tag, the keywords meta tag, and the text in the document itself. You only need to run the indexer when new pages are added to the site. It can be run via telnet or through a Web browser.

You can easily limit the directory and files that are indexed. You can also limit the words that can be used in the search (each time a search is made, it uses RAM memory on the server). For example, if you have a Web site about the Delta blues, you might want to eliminate the words "Delta" and "blues" from the search parameter as they will probably be scattered throughout most of your Web pages and would return a large number of search results. These two features give you complete control over what is and what is not indexed on your Web site.

The other main file does the actual searching itself. Together, these two files create a smoothly running search engine.

Search Results Page
Search Results Page (Fully Customizable)


There are a large variety of features available in this little package:

  • search terms can be highlighted, making it easy for your visitors to find the searched words on the page;
  • completely customizable search output page using HTML/CSS templates;
  • the results page can be displayed in any language (English, German, French, and Italian templates included);
  • the output results include words from the page title, description, URL, and relevance ranking (see graphic above);
  • number of results per page can be customized;
  • sentences or sections within a document can be marked so as not to be included in the indexing;
  • search results can include PDF (requires pdftotext) and MS-Word (requires Antiword) files;
  • specific user-definable words can be excluded from searches;
  • the minimum length of search words can be set;
  • advanced search query options, such as inclusion (+) and exclusion (-) parameters;
  • database program is not required; and
  • dynamically generated files (e.g., PHP) can also be indexed.


Installing the script really couldn't be easier. Actually it can. Perlfect Solutions will install it for you for $100.00. The script has a built-in installer that does the work for you. Just upload the temporary directory, run the installer, answer a few questions, and you're good to go! Doing it manually is also easy, but you need to edit the configuration file yourself. The script can also be installed manually, if you desire to go that route.


Overall, this search script is a "perlfect" answer if you're looking to add an internal search engine to your Web site. It has all the capabilites that the big guys have and can be customized to fit your needs. It even has a discussion mailing list (with archives) if you have installation problems, requests for new features, patches, etc. (Even though the latest update was done in March 2003, the discussion list is still active).

I installed it on one of my personal Web sites within a few minutes. After another few minutes of customizing and tweaking, I was all set.

General information:

  • Script: Perlfect Search
  • Written in: Perl
  • Cost: Free (GPL)
  • Available from: Perlfect Solutions
  • Requirements: Perl 5.004 or higher and access to CGI bin (DB_File 1.72 module may be required)

Created: December 13, 2004