Skip to main content.
home | support | download

Back to List Archive

Re: CGI trouble with swish-e

From: Bill Moseley <moseley(at)>
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/, 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/ 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 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

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{''}\n";

That will print out where 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{""}';

Bill Moseley

Unsubscribe from or help with the swish-e list:

Help with Swish-e:
Received on Fri May 26 06:27:41 2006