Skip to main content.
home | support | download

Back to List Archive

Re: CGI trouble with swish-e

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Fri May 26 2006 - 13:27:32 GMT
On Fri, May 26, 2006 at 01:34:20PM +0100, Lewis Foster wrote:
> Does anyone perhaps have any other scripts they use to search a swish index?

Isn't there a PHP script floating around?  Check the list archive or
wait for someone to post info.

> The standard search.cgi just will not work on my system.

What's your system?

> I've tried a new
> install and i've gone through installing Template-Toolkit,
> HTML/FillInForm.pm, CGI.pm and more but I just end up getting to the same
> error:
> 
> Can't locate object method "new" via package "Template" at
> /opt/www0/apache/rancor.com/cgi-bin/search/search.cgi line 285.

What's at line 285?

Seems like there's a different package called Template some place,
but it's the wrong one.

This says that Template was loaded correctly, but there's not method
"foo" in that class (package):

    $ perl -MTemplate -le 'Template->foo';
    Can't locate object method "foo" via package "Template" at -e line 1.

This is what happens when you forget to load the module:

    $ perl  -le 'Template->foo';
    Can't locate object method "foo" via package "Template" (perhaps
    you forgot to load "Template"?) at -e line 1.


And this is what happens when a module is not installed:

    $ perl -MBlabla -le 'Blabla->foo';
    Can't locate Blabla.pm in @INC (@INC contains: /etc/perl
    /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8
    /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8
    /usr/share/perl/5.8 /usr/local/lib/site_perl
    /usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7
    /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4
    /usr/local/lib/perl/5.8.2 /usr/local/share/perl/5.8.2
    /usr/local/lib/perl/5.8.1 /usr/local/share/perl/5.8.1
    /usr/local/lib/perl/5.8.0 /usr/local/share/perl/5.8.0 .).
    BEGIN failed--compilation aborted.


So, it looks like somehow you have a different module named Template
loaded.

Did you modify the swish.cgi configuration?

Try this:

I'm not sure what is at your line 285 (I have a comment in my
swish.cgi at that line), but right before that do:

    warn "Template => $INC{'Template.pm'}\n";

That will print out where Template.pm is located, and will hopefully
make it clear what's wrong.

You can also try it from the command line, but that's not the same
environment as when the script is running, so you have to do it from
the script.

$ perl -MTemplate -le 'print $INC{"Template.pm"}';
/usr/lib/perl5/Template.pm

-- 
Bill Moseley
moseley@hank.org

Unsubscribe from or help with the swish-e list: 
   http://swish-e.org/Discussion/

Help with Swish-e:
   http://swish-e.org/current/docs
   swish-e@sunsite.berkeley.edu
Received on Fri May 26 06:27:41 2006