Skip to main content.
home | support | download

Back to List Archive

Re: ASP and PerlScript on Windows (was Fixing Swish)

From: Bill Moseley <moseley(at)>
Date: Fri Dec 12 2003 - 15:54:01 GMT
On Fri, Dec 12, 2003 at 06:15:36PM +1030, Ahmad, Zeeshan (FMC) wrote:
> 2.4.0 To Work on W
> >>My guess is you are using relative paths and when using ASP
> >>you have a different "current directory" than when using CGI.
> I know - that's quite logical - but the remedy (absolute path) doesn't work.

Can you show some actual error mesages that show why it's not working?
"Show all your work". ;)

> I have tried to use both absolute and relative paths. I tried to set
> absolute path via $ENV and use lib - this doesn't help either. Perl seems to
> be searching in its own install directory for SWISH::ParseQuery.
> Note that the use lib path whish is set at install (in swish.cgi) doesn't
> work at all - via cgi or ASP.

Here's how swish.cgi tries to load modules:

sub load_module {
    my $package = shift;
    $package =~ s[::][/]g;
    eval { require "$" };
    if ( $@ ) {
        print <<EOF;
Content-Type: text/html

<head><title>Software Error</title></head>
<body><h2>Software Error</h2><p>Please check error log</p></body>

        die "$0 $@\n";

Notice how it dies with $@?  That means you should have an error message 
someplace that tells you why it failed to load the module:

moseley@laptop:~/swish-e/example$ perl -le 'require Bla'
Can't locate in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.8.2 /usr/local/share/perl/5.8.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8.2 /usr/share/perl/5.8.2 /usr/local/lib/site_perl /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 .) at -e line 1.> 

Then you can see what path @INC really is.  

For debugging perl I use:

   print $something while $in_doubt;

Bill Moseley
Received on Fri Dec 12 15:54:07 2003