Skip to main content.
home | support | download

Back to List Archive

Re: swish.cgi script (on Windows 2000)

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Thu Feb 27 2003 - 23:48:31 GMT
On Thu, 27 Feb 2003 jinche04@quicksilver.net.nz wrote:

> > [Thu Feb 27 21:38:45 2003] [error] [client 127.0.0.1] Premature end of
> > script headers: c:/wwwroot/cgi-bin/mytest.cgi

That means the script aborted or returned an error or something that was
not a correct header.  Not very interesting.  When I see this error I then
run the script from the command line and look at the output.  You have to
keep in mind that the server may be running the script under a different
environment so it's possible to run the script from the command prompt and
have it look fine, yet fail when running on the web server.  That's all
basic CGI debugging, of course.


> > [Thu Feb 27 21:38:45 2003] [error] [client 127.0.0.1] Undefined
> > subroutine &TemplateDefault::page_header called at
> > c:/wwwroot/cgi-bin/example/modules/TemplateDefault.pm line 16. 

Again, that seems odd because page_header() is defined in that same
module.  So it somehow got undefined.  In other words, I'm confused about
it, too.  (doesn't mean it's not something obvious).

Anyway, I was suggesting going to the directory where TemplateDefault.p is
located and running:

perl -MTemplateDefault -e  'TemplateDefault::page_header()'
Can't call method "config" on an undefined value at TemplateDefault.pm
line 41.

Which shows me that the funtion does indeed exist (but I'm not passing it
any valid data, hence the error).


> > I only make some changes( change the path) on this swish.cgi file: 

> >         highlight       => {
> >             package         =>
> > 'C:/wwwroot/cgi-bin/example/modules/PhraseHighlight',

You don't need to do that.  That "use lib" line you modified adds a path
to the @INC array, which perl uses to locate modules.

If the script is run in C:/wwwroot/cgi-bin/example/swish.cgi, then all you
shouldn't really need to modify the use lib line from its default of

   use lib 'modules';



> >         xtemplate => {
> >             package     =>
> > 'C:/wwwroot/cgi-bin/example/modules/TemplateDefault',

Same here, although all those are "commented out" because of the "x".  But
you don't need the full path.

> > how can i get results with highlight keyword and a little description,
> > and also paging. 

That script should do it.  You need to make sure that you create an index
that has the descriptions.  That's explained in the swish.cgi docs.




-- 
Bill Moseley moseley@hank.org
Received on Thu Feb 27 23:48:54 2003