perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ronni <bou...@inl.gov>
Subject Re: Bareword "Apache::OK" not allowed while "strict subs" in use
Date Tue, 28 Jun 2005 19:34:44 GMT


Philip M. Gollucci wrote:

> Ronni wrote:
>
>> I have spent many days now searching through the archives and 
>> although they are close to what I am seeing none are exactly like 
>> what I have.
>>
>> I am using Apache 2 and installing ModPerl 2 on a Linux Mandrake 10.1 
>> box.  Apache 2 is a recent install and ModPerl 2 is something I would 
>> like to get working soon.
>>
>> I can run perl from cgi-bin but would like to keep the perl stuff in 
>> it's own directory.  I've set this up numerous times using the 
>> ModPerl online documentation as well as all the Apache/ModPerl info I 
>> can find.
>>
>> I've added the following to the httpd.conf file:
>>
>> PerlModule Apache2                                 ##This allows perl 
>> -V to look in /Apache2/ under the perl install
>>  Alias /perl/ /usr/local/apache2/perl/         ##The directory I 
>> would like to keep the perl scripts
>>  <Location /perl>
>>      SetHandler perl-script
>>      PerlResponseHandler ModPerl::Registry
>>      PerlOptions +ParseHeaders
>>      PerlOptions -GlobalRequest
>>      Options +ExecCGI
>>  </Location>
>>
>> The log file shows the following at apache startup:
>>
>>        [Tue Jun 28 08:42:59 2005] [notice] Apache/2.0.54 (Unix) 
>> mod_perl/2.0.1 Perl/v5.8.5 configured --           resuming normal 
>> operations
>>
>>
>> So it appears that everything is fine.
>> Then when I use an address like the following:
>>
>>        http://localhost/perl/rock.pl
>>
>> with the following in rock.pl
>>
>>       #!/usr/bin/perl
>>
>>          print "Content-type: text/plain\n\n";
>>          print "mod_perl 2.0 rocks!\n";
>>
>> I get an Internal Server Error page with the following in the error_log:
>>
>>        [Tue Jun 28 13:00:31 2005] [error] [client 127.0.0.1] failed 
>> to resolve handler `ModPerl::Registry':           Bareword 
>> "Apache::OK" not allowed while "strict subs" in use at
>>        
>> /usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Apache2/ModPerl/RegistryCooker.pm

>> line
>>        160.\nBareword "Apache::OK" not allowed while "strict subs" in 
>> use at
>>        
>> /usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Apache2/ModPerl/RegistryCooker.pm

>> line
>>        162.\nBareword "Apache::OK" not allowed while "strict subs" in 
>> use at
>>        
>> /usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Apache2/ModPerl/RegistryCooker.pm

>> line
>>        170.\nBEGIN not safe after errors--compilation aborted at
>>        
>> /usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Apache2/ModPerl/RegistryCooker.pm

>> line
>>        200.\nCompilation failed in require at (eval 4) line 
>> 3.\n\t...propagated at /usr/lib/perl5/5.8.5/base.pm line
>>        85.\nBEGIN failed--compilation aborted at
>>        
>> /usr/lib/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi/Apache2/ModPerl/Registry.pm

>> line
>>        25.\nCompilation failed in require at (eval 3) line 3.\n
>>
>> Have I lost my mind?  I'm new to modperl.  Thanks in advance for any 
>> help that you would be able to offer!  Trust me!  It is GREATLY 
>> appreciated!
>>
>> Thanks!
>> Ronni
>
>
>
> You're trying to mix mp2 apis.  It change drastically in mp2 1.99 RC5.
>
> Apache2.pm from PerlModule Apache2 no longer exists.  You've managed 
> to install mp2.0.0+ over an older version before 1.99 RC5 which 
> shouldn't be possible.
>
> Read this:
> http://perl.apache.org/docs/2.0/rename.html
>
> The constant should be written as
> Apache2::Const::OK
>
> >PerlModule Apache2                                 ##This allows perl 
> -V to look in /Apache2/ under the perl install
> That won't affect perl -V since its in your httpd.conf
>
> What it *USED* to do was change your @INC at run-time to look in the 
> right place.  See the above link for why you don't do this anymore.
>
> HTH
>
>

Thanks for the reply Philip but I'm still in the dark.  I have read that 
post a few times and I have updated my CGI stuff.  Is something not 
updated?  Do I need to remove something?  To be honest I'm not even 
certain I would be smart enough to mix anything.  I just downloaded 
Apache2 and installed it then downloaded ModPerl2.0.1 from CPAN and 
followed the ModPerl online instructions.

PerlModule Apache2 does affect the perl -V that I see.  If I omit this 
line then I don't look in the perl path of /Apache2/ while adding this 
line allows perl -V to show a perl path ending in /Apache2/.  Are you 
suggesting I remove it?

Thanks for the help. 

What does HTH stand for anyway?

Ronni

Mime
View raw message