While it isn't Perl, in the redesign of http://www.stonehenge.com, I was able to reverse-engineer the form used for a "search within results" http://www.google.com query. Cut and paste this to your site, changing stonehenge.com (twice) to your website, and get your own "search this site" form field!

Of course, Google is free to break this format. But it works for now!

<form action="http://www.google.com/search" method=GET> <INPUT TYPE=hidden name=site value=swr> <INPUT TYPE=hidden name=q value="site:stonehenge.com"> <INPUT TYPE=text name=as_q size=31 maxlength=256 value=""> <INPUT TYPE=submit name=btnG VALUE="Search stonehenge.com with Google" +>

Replies are listed 'Best First'.
Re: •Add "search this site with google" to your web site
by ignatz (Vicar) on Apr 20, 2002 at 13:00 UTC
    FYI, Google offers a free search service for web sites.

    UPDATE:
    I just noticed that Juerd put this site up for consideration with the comment "Although it's good advice, it's not Perl", which got to me thinking.

    I don't consider this good advice. Putting up an HTML form that is directed twords another site that isn't their recommended use, doesn't use the free (or not for that matter) services that they provide, and which may violate their terms of service isn't a good idea. They're nice enough to provide free ways to take advantage of their services. Don't just hack their HTML, take advantage of them.

    ()-()
     \"/
      `                                                     
    
Re: &bull;Add "search this site with google" to your web site
by belg4mit (Prior) on Apr 19, 2002 at 23:56 UTC
    Something that is perl ;-) and pretty effective is Perlfect Search. Not perfect, but pretty good. It's the best I could find when looking for a search engine for my site recently. (Yes, I considered piggybacking on Google ;-).

    And here's a patch to add support for robots.txt compliance.

    --
    perl -pe "s/\b;([mnst])/'\1/mg"

(cLive ;-) Re: •Add "search this site with google" to your web site
by cLive ;-) (Prior) on Apr 20, 2002 at 23:27 UTC
    What might be even more useful is their API that they've recently opened up which is free for non-commercial use.

    Of course, that's not Perl either - currently Java or .NET

    cLive ;-)

      Eh?
      use SOAP::Lite;
      There you go, now it's Perl.

      SMiTZ
        Or:

        use Net::Google

        There you go: now it's Perl with all the work done for you.

        MB