?
Solved

Perl Search Engine

Posted on 1999-12-18
13
Medium Priority
?
287 Views
Last Modified: 2010-03-05
Can some one write a perl search engine for me. I need it for Unix. It needs to be fully customizable, and easy to use. I will provide addition info as it is need. I will change points availbel if it is harder than i think.
0
Comment
Question by:steath_acid
  • 5
  • 3
  • 2
  • +2
13 Comments
 
LVL 8

Expert Comment

by:jhurst
ID: 2292797
M company has one available but we do charge for it.  If you are interested in licensing it feel free to send me eMail to: custom@resource.nu
0
 
LVL 2

Expert Comment

by:cadabra
ID: 2293230
Take a look at:

http://hotwired.lycos.com/webmonkey/97/16/index2a.html?tw=programming

which gives code for a basic search engine, working on unix with CGI.

Also, If you need a search engine (free) there are ready made engines you can install on your LAN so long you don't have too many files (less than 3000 if I recall).

Is this an option ? Or must it be an engine developed in PERL ?


0
 
LVL 1

Expert Comment

by:eae
ID: 2293756
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 

Author Comment

by:steath_acid
ID: 2294051
cgi-resources does not have anything that will work for me. I want a custom script. Is it worth more than this?
0
 
LVL 2

Expert Comment

by:cadabra
ID: 2295036
Please post your requirements from the search engine scripts, and define what you mean by fully customizable.

0
 

Author Comment

by:steath_acid
ID: 2296252
OK it must be able search a specific director, must we perl, must allow customizable results pages. The easier the better.
0
 
LVL 8

Expert Comment

by:jhurst
ID: 2296279
I think you need to understand that people who post answers here tend to do it as a way of sharing with the community.  Not for the points.  Realistically, the points have little or no value.  As such, it may not be possible to find someone to do real work just for points.  

I can tell you that we have done a lot of work for money, for people who have found us here.  (End of self serving plug).
0
 

Author Comment

by:steath_acid
ID: 2296822
Well if it comes to that I will pay for it to be done, but not unless it is absolutly required.
0
 
LVL 8

Expert Comment

by:jhurst
ID: 2298244
If you get to that point eMail me at: custom@resource.nu - I would be happy to provide references.
0
 
LVL 4

Accepted Solution

by:
furu earned 3000 total points
ID: 2318396
use CGI qw(:standard);

my($searchdir) = "yourdir/yoursubdir";

# for top/bottom files....
my($htmldir) = "yourdir/htmlpages";

my($word) = param('keyword');

opendir DIR, $searchdir;
my(@files) = readdir DIR;

foreach my $file (@files) {
 next if $file =~ m!^\.{1,2}!;
 next if -d "$searchdir/$file";
 
 open (FILE, "$searchdir/$file");
 my(@lines) = <FILE>;
 close FILE;
 
 foreach my $line (@lines) {
# remove last i for case sensitive search.
  if ($line =~ m!$word!i) {
   push (@matches, $file);
  }
 }
}

# Matching files are now stored in @matches

my($number_of_matches) = @matches;
my($matchno); #counter

foreach my $match (@matches) {
 $matchno++;
# Modify after the next line to customize each match-line.
 push (@output_lines, <<__END_HTML__);
$matchno. <A HREF="$match">$match</A><BR>
<BR>
__END_HTML__

}


# Looks for top.html and bottom.html. Modify these to change the output.
open (FILE, "$htmldir/top.html");
print <FILE>;
close FILE;

print @output_lines;

open (FILE, "$htmldir/bottom.html");
print <FILE>;
close FILE;

# That's how much you'll get for free :-)
# Y.s.
# furu
0
 

Author Comment

by:steath_acid
ID: 2328063
Ok, so first of all what did you leave out. I will try it asap. But i need to know what you mean by: "That's how much you'll get for free".
0
 
LVL 4

Expert Comment

by:furu
ID: 2328465
Nothing, the engine should work just like it is now. See the comments for instructions.

Y.s.
0
 

Author Comment

by:steath_acid
ID: 2354983
Well I have not had enough time and have decided to use a less, very much less effective solution. But I thank you for your opionion. In turn I will go ahead and reward you your points(they were free anyway). I Thank Everyone for your input.
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans
Suggested Courses

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question