Skip to main content.
home | support | download

Back to List Archive

Re: "Ambiguous use" swish.cgi error

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Sat Jan 26 2002 - 07:10:19 GMT
At 06:58 PM 1/25/2002 -0800, Kate Ericson wrote:

>I set up the most basic .swishcgi.conf in the same directory as swish.cgi 
>(and didn't edit the configuration parameters in swish.cgi), and I believe 
>the script is correctly pointing to the location of my perl program and the 
>modules.  My .swishcgi.conf file is as follows:
>
>return {
>  title => 'Search',
>  swish_binary => '.[my path to executable]/swish-e',
>  swish_index => '[my path to index]/index.swish-e',
>};

This works for me:

~/rich > cat .swishcgi.conf
return {
  title => 'Search',
  swish_binary => './swish-e',
  swish_index => 'index.swish-e',
};

>However, when I run ./swish.cgi I get a bunch of "Ambiguous use" errors, 
>such as "Ambiguous use of package => resolved to "package" => at 
>./swish.cgi line 304".  These errors end with "BEGIN not safe after 
>errors--compilation aborted at ./swish.cgi line 1079."
>
>Any help is greatly appreciated!

What version of perl are you using?

58) ~ %perl5.00503 -we '%x = ( package => 4 )'
Name "main::x" used only once: possible typo at -e line 1.

59) ~ %perl5.005 -we '%x = ( package => 4 )'
Name "main::x" used only once: possible typo at -e line 1.

60) ~ %perl5.002 -we '%x = ( package => 4 )'
Ambiguous use of package => resolved to "package" => at -e line 1.
Identifier "main::x" used only once: possible typo at -e line 1.

This is perl, version 5.004_01

Copyright 1987-1997, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.

>/usr/local/bin/perl  -we '%x = ( package => 4 )'
Ambiguous use of package => resolved to "package" => at -e line 1.
Name "main::x" used only once: possible typo at -e line 1.

Looks like you are using a very old version of perl.  

Regardless, I'd think that's just a warning telling you that "package" is a
reserved word and is placing it in quotes.  Newer perls are smart enough to
see that "package" in no used in a keyword context and that there's nothing
to fix.

But the being not safe is odd.  You really need a newer perl, but you can
put that "package" in quotes on the line specified above, and then run the
script from the command link to see if you get any errors.





Bill Moseley
mailto:moseley@hank.org
Received on Sat Jan 26 07:10:55 2002