Need help in comparing a file with log file: perl code

Dear Members,

I need a perl code:

  1. Which will open first file with two columns separated by tab:

37 Distribution and seasonal variation of trace metals
85 Seasonal variability of the mixed layer in the central Bay
99 Dynamics of transparent exopolymeric particles (TEP)
103 Bacterial extracellular polymeric substances (EPS): A carrier

  1. Then open web server log files from a folder as per the first column of each line from the first file (such as 37.txt or 85.txt or 99.txt 103.txt etc).

  2. Then take the words separated by space (except a, an, the, of, and, etc) from the 2nd column of respective line of first file and count the words, count1++

  3. Match the words from $line first files in the 2nd file (log file) each $line. For each word match in each $line of 2nd file, do count2++

  4. The required out put file format is

first column (IP) of 2nd file (i.e. log file) tab(\t) count2++ tab(\t) value of count2++/count1++

Extracted Log hits in a file 103.txt as follows:

59.144.4.65 - - [05/Aug/2006:11:53:23 +0530] "GET /drs/bitstream/2264/103/3/Environ_Int_32_191.pdf HTTP/1.1" 200 383974 "bioremediation\ of\ heavy\ metals - Google Search" "Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7"
200.27.127.33 - - [08/Aug/2006:03:08:51 +0530] "GET /drs/bitstream/2264/103/3/Environ_Int_32_191.pdf HTTP/1.1" 200 383974 "concentration\ EPS\ bacteria - Buscar con Google" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)"

Thanks