You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Igor Chudov <ic...@yahoo.com> on 2005/05/09 22:12:05 UTC

Bareword "Apache2::Const::OK" not allowed

I have just installed new Apache 2.0.54 and mod_perl
(the latest). When running it, load of a webpage
results in 

"Apache2::Const::OK" not allowed:

[Mon May 09 15:07:13 2005] [error] [client
64.94.157.1] failed to resolve handler
`ModPerl::PerlRun': Bareword "Apache2::Const::OK" not
allowed while "strict subs" in use at
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/ModPerl/RegistryCooker.pm
line 171.\nBEGIN not safe after errors--compilation
aborted at
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/ModPerl/RegistryCooker.pm
line 201.\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/site_perl/5.8.5/i386-linux-thread-multi/ModPerl/PerlRun.pm
line 25.\nCompilation failed in require at (eval 3)
line 3.\n, referer:
http://dsl.algebra.com/algebra/homework/coordinate/Linear_Equations.faq.hide_answers.1.html


- Igor



		
__________________________________ 
Yahoo! Mail Mobile 
Take Yahoo! Mail with you! Check email on your mobile phone. 
http://mobile.yahoo.com/learn/mail 

Re: Bareword "Apache2::Const::OK" not allowed

Posted by Stas Bekman <st...@stason.org>.
Igor Chudov wrote:
> Well, it complained about all uses of Apache2::Const
> and APR::Const.
> 
> I replaced all such calls with calls().
> 
> After that, it complained about line 122 of
> RegistryCooker:
> 
> sub init { 
>     $_[0]->{REQ}      = $_[1]; 
>     $_[0]->{URI}      = $_[1]->uri; 
> ^^^^^^^^^^^^^^^^ this line
>     $_[0]->{FILENAME} = $_[1]->filename; 
> } 
> 
> [Mon May 09 15:57:41 2005] [error] [client
> 64.94.157.1] Can't locate object method "uri" via
> package "Apache::RequestRec" at
> /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/ModPerl/RegistryCooker.pm
> line 122.\n
> 
> any ideas?

I guess that explains it. there is no Apache::RequestRec in mp2, there is
Apache2::RequestRec. Your install probably has a mix of pre-RC5 and post 
RC5, try nuking *all* mod_perl modules in your perl tree, install from 
scratch and try again. If the problem persist please submit a  proper bug 
report as explained at: http://perl.apache.org/bugs/ thanks.

-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: Bareword "Apache2::Const::OK" not allowed

Posted by Igor Chudov <ic...@yahoo.com>.
Well, it complained about all uses of Apache2::Const
and APR::Const.

I replaced all such calls with calls().

After that, it complained about line 122 of
RegistryCooker:

sub init { 
    $_[0]->{REQ}      = $_[1]; 
    $_[0]->{URI}      = $_[1]->uri; 
^^^^^^^^^^^^^^^^ this line
    $_[0]->{FILENAME} = $_[1]->filename; 
} 

[Mon May 09 15:57:41 2005] [error] [client
64.94.157.1] Can't locate object method "uri" via
package "Apache::RequestRec" at
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/ModPerl/RegistryCooker.pm
line 122.\n

any ideas?

--- Stas Bekman <st...@stason.org> wrote:

> Igor Chudov wrote:
> > I have just installed new Apache 2.0.54 and
> mod_perl
> > (the latest). When running it, load of a webpage
> > results in 
> > 
> > "Apache2::Const::OK" not allowed:
> > 
> > [Mon May 09 15:07:13 2005] [error] [client
> > 64.94.157.1] failed to resolve handler
> > `ModPerl::PerlRun': Bareword "Apache2::Const::OK"
> not
> > allowed while "strict subs" in use at
> >
>
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/ModPerl/RegistryCooker.pm
> > line 171.\nBEGIN not safe after
> errors--compilation
> > aborted at
> >
>
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/ModPerl/RegistryCooker.pm
> > line 201.\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/site_perl/5.8.5/i386-linux-thread-multi/ModPerl/PerlRun.pm
> > line 25.\nCompilation failed in require at (eval
> 3)
> > line 3.\n, referer:
> >
>
http://dsl.algebra.com/algebra/homework/coordinate/Linear_Equations.faq.hide_answers.1.html
> 
> Strange, any difference with this patch?
> 
> Index:
> ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
>
===================================================================
> --- ModPerl-Registry/lib/ModPerl/RegistryCooker.pm  
>    (revision 169356)
> +++ ModPerl-Registry/lib/ModPerl/RegistryCooker.pm  
>    (working copy)
> @@ -168,7 +168,7 @@
>       my $old_status = $self->{REQ}->status;
>       my $rc = $self->run;
>       my $new_status =
> $self->{REQ}->status($old_status);
> -    return ($rc == Apache2::Const::OK &&
> $old_status != $new_status)
> +    return ($rc == Apache2::Const::OK() &&
> $old_status != $new_status)
>           ? $new_status
>           : $rc;
>   }
> 
> 
> 
> -- 
>
__________________________________________________________________
> Stas Bekman            JAm_pH ------> Just Another
> mod_perl Hacker
> http://stason.org/     mod_perl Guide --->
> http://perl.apache.org
> mailto:stas@stason.org http://use.perl.org
> http://apacheweek.com
> http://modperlbook.org http://apache.org  
> http://ticketmaster.com
> 


- Igor


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Bareword "Apache2::Const::OK" not allowed

Posted by Stas Bekman <st...@stason.org>.
Igor Chudov wrote:
> I have just installed new Apache 2.0.54 and mod_perl
> (the latest). When running it, load of a webpage
> results in 
> 
> "Apache2::Const::OK" not allowed:
> 
> [Mon May 09 15:07:13 2005] [error] [client
> 64.94.157.1] failed to resolve handler
> `ModPerl::PerlRun': Bareword "Apache2::Const::OK" not
> allowed while "strict subs" in use at
> /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/ModPerl/RegistryCooker.pm
> line 171.\nBEGIN not safe after errors--compilation
> aborted at
> /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/ModPerl/RegistryCooker.pm
> line 201.\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/site_perl/5.8.5/i386-linux-thread-multi/ModPerl/PerlRun.pm
> line 25.\nCompilation failed in require at (eval 3)
> line 3.\n, referer:
> http://dsl.algebra.com/algebra/homework/coordinate/Linear_Equations.faq.hide_answers.1.html

Strange, any difference with this patch?

Index: ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
===================================================================
--- ModPerl-Registry/lib/ModPerl/RegistryCooker.pm      (revision 169356)
+++ ModPerl-Registry/lib/ModPerl/RegistryCooker.pm      (working copy)
@@ -168,7 +168,7 @@
      my $old_status = $self->{REQ}->status;
      my $rc = $self->run;
      my $new_status = $self->{REQ}->status($old_status);
-    return ($rc == Apache2::Const::OK && $old_status != $new_status)
+    return ($rc == Apache2::Const::OK() && $old_status != $new_status)
          ? $new_status
          : $rc;
  }



-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com