MSA - Matt's Script Archive
 Matt's Script Archive: Simple Search: Frequently Asked QuestionsView All FAQs @ MSA
 
  Other sites by Matt:
 FormMail.com
  - hosted form processor


  Matt's Script Archive
    FormMail
    Guestbook
    WWWBoard
    Simple Search
      Readme
      Download
      Demo
      > FAQ 
    Counter
    TextCounter
    Random Text
    TextClock
    Free for all Links
    Random Link
    HTTP Cookie Library
    Countdown
    Random Image
    SSI Random Image
    TextCounter C++
    TextClock C++

Simple Search Frequently Asked Questions
    1. How can I search recursively down directories?
    2. How many files can this program search through?
1. How can I search recursively down directories?
This version of the Simple Search Script does not allow you to search recursively down directories, although I am planning it in the next release. You can however, make a crude hack, by simply using the following solution. Say you want to search all html file 3 directories deep. All you would have to put in your @files array is:

@files = ('*.html/','*/*.html','*/*/*.html','*/*/*/*.html');
2. How many files can this program search through?
Short Answer:

As Many as you provide it, however this is not always a good idea.

Long Answer:

It will vary from machine to machine. After a while perl might run out of memory if you supply it with too many pages, but before that happens, you will probably notice it takes too long to search your site. When conversing with one user of the script, after they had asked if my script could search through 16,000 html files (7 MB total), I asked how much the script could handle. Here is the response:

Your doubts were well founded. I tried it as an exercise; after a few hundred, things start slowing down. With about 2,000, not worth mentioning.

-- Robert Savage


Use the script within reason. It runs fairly fast on my site, and I have it searching about 400 - 500 KB in files. It all depends on the speed of your machine and how long you think users are willing to wait.

 

FormMail.com :: HTML Form to Email Processor
[ Linking to MSA | Advertising Opportunities | Contact Matt ]
© 1995 - 2009 Matt Wright and Matt's Script Archive, Inc.