husoft has asked for the wisdom of the Perl Monks concerning the following question:

Hello monks!

I made a small search for the local files of my site, click here to see it working. as you can see, to show results Im using the title of every page found but I also want to add the line where it found this particular string the user searched for... (google style). I tried doing it locally with grep thinking to make it trough my script exporting results to a file then importing it to a var and printing the results, but it shows the html tags and everything. Any ideas?

Replies are listed 'Best First'.
Re: small search script
by BUU (Prior) on Oct 06, 2002 at 05:42 UTC
    Heres a totally non-perl related idea, why not just goto google and get a sexy google search for your site, allowing you to harness the full power of google?
Re: small search script
by abell (Chaplain) on Oct 06, 2002 at 13:07 UTC

    Instead of indexing the HTML, I'd personally index a text version obtained with tools such as HTML::FormatText.

    Cheers

    Antonio

    The stupider the astronaut, the easier it is to win the trip to Vega - A. Tucket
Re: small search script
by Anonymous Monk on Oct 07, 2002 at 02:36 UTC
    Gee! Does it work like ...
    find . -name '*.html' -exec grep 'whatever' {} \;
Re: small search script
by Anonymous Monk on Oct 07, 2002 at 11:36 UTC
    Here's an idea: Use a content-type of text/html for html, instead of text/plain!