At 08:57 AM 01/31/02 -0800, Gordon Jessop wrote:
>I was under the impression that fork was expensive compared to SWISHE.pm in
>a cgi (as opposed to mod_perl) environment. I also want to avoid the
>pitfalls (security and otherwise) of building my own wheel, so to speak.
Look back through the messages. I just discussed this in a reply to you:
http://swish-e.org/archive/3387.html.
As for security, read perldoc perlsec for perl scripts.
The swish.cgi script that's included in the distribution doesn't run swish
through the shell, so avoids the security issue with piped opens.
>Is SWISHE.pm the wrong way to go? If so, is there a roadmap for a different
>route?
I posted a few days ago a terminal session where I build a searchable
archive in just a few steps using the swish.cgi script. You might start
there and then worry about making things faster.
The original plan of SWISH.pm (not SWISHE.pm, but the one on CPAN) was to
provide a general purpose API for connecting to swish. DBI for swish, if
you will. Changing one word in your script would change the way swish was
accessed - via forking or via the library. Good idea, but I'm not sure
how useful that is in real life.
If you are running a CGI script then using the C library will have almost
NO effect on speed since the CGI (with perl compilation) is so slow
compared to forking it's not worth thinking about. If you want speed use
mod_perl.
--
Bill Moseley
mailto:moseley@hank.org