Skip to main content.
home | support | download

Back to List Archive

Re: [SWISH-E:132] Re: swish-e CGI

From: Eli's List Clearing House <lch(at)>
Date: Thu Jan 29 1998 - 16:50:12 GMT
Omar Thameen <> wrote:
> >
> Wow, I was going to post a modified version of the search-cgi, but
> it only added the ability to limit the search to a list of indexes.
> This one is much more complete and portable (not to mention above
> my perl writing at this point).  Thanks for sharing.

Thanks. Would you believe it is my first effort at a CGI? Much of the
style is influenced by brian d foy's posts to comp.lang.perl.misc.

> BTW, I tried using it, but I'm getting
> delete argument is not a HASH element at /home/path/to/search.cgi line 30.
> 30: delete @ENV{'IFS', 'CDPATH', 'PATH', 'ENV', 'BASH_ENV'};

Ah. I guess my comments where not enough. perl 5.004 is the only perl
that does not have CERT security warnings against it, and so should be
the only one you use for CGI stuff. One of the changes between 5.003
and 5.004 is the removal of that error message. That statement is
mostly paranoia, not all of those are going to be set in all environments,
and in a CGI it is unlikely any of them would have a dangerous value, it
is mostly a legacy of thinking about setuid perl scripts.

> So while I'm writing, here are my suggestions for future versions of
> swish-e.
> 1. When "a word is too common", report the word that is too common.
> 2. When searching multiple indexes, don't stop processing if one of 
>    the files doesn't exist, move on to the next one and print the
>    errors at the end.
  3. When searching multiple index files, don't sort the ranks of return
     results individually. (At least I think that is what is happening.)

#!/usr/bin/perl -- -*- my sig -*-
$_=$^ ;s;s;sss;;s^.^ju^&&s&P+&\n&&&(s(_..)(ers)||s|^|^^|)&&s(T)(q(st%eg))eg;
s<.(o).><$& new 1$$>i+s+\dst.+$a--||reverse(q(rep k))+ge;s*%.+u* so+*i;s=\++
="me"=mex&&s%ege%l$"hke%;$a||s/^\S+ /\/\//;s;\d+;yor;;s[KE]<ac$&>i;print $_;
Received on Thu Jan 29 09:06:02 1998