Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple perl search routine

Status
Not open for further replies.

jriggs420

Programmer
Sep 30, 2005
116
US
I'm using a text file to hold some information about files, like a mini-database (I know, I know). I'm trying to write a little sub-routine that will let the user enter 1, 2, OR 3 terms, and will return results arranged by relevence. Like m/($term1 AND $term2 AND $term3) then m/($term1 AND (term2 OR $term3)) then m/($term1 OR $term2 OR $term3), and so on. The examples I have found online, I feel are too robust for the scale I am attempting.

Having a hard time wrapping my head around the logic, especially since terms 2 and 3 are not required, and I don't want duplicate results. Near (like) matching would be nice too, but I would like to get the basics first. A nudge or gentle kick in the appropriate direction would be much appreciated. TIA

Because a thing seems difficult for you, do not think it impossible for anyone to accomplish.
Marcus Aurelius
 
perlfect search is a free indexing and search script, well worth a look, you'll learn loads, I used to use this on an intranet, and it was ideal, and if the company didn't go bang, it'd probably be still in use in that location at least. ;-)

Paul
------------------------------------
Spend an hour a week on CPAN, helps cure all known programming ailments ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top