Shannon Eric Peevey wrote:
Stas Bekman wrote:

Shannon Eric Peevey wrote:
[...]

Also, you don't realy have to do that. The old ala mp1 style works just fine.

use Apache::Const qw(OK DECLINED)

sub handler {

return OK;
}




Well... I must have been smoking crack, 'cause I seem to remember a simple:

return MP2 ? Apache::OK : OK

throwing an error, hence, the change to:

MP2 ? Apache::OK : Apache::Constants::OK

Now that I test it, though, there doesn't seem to be a problem... :P



May be you haven't been importing the constant. These two aren't the same:


use Apache::Const qw(OK DECLINED);
use Apache::Const -compile => qw(OK DECLINED);

the latter only compiles the constants, the former compiles and imports it.

[...]

Just started working on Apache-AuthNTLM and came across the cross reference that you posted awhile back. This might be where I got it:

 sub handler {
     # ...
     return MP2 ? Apache::OK : Apache::Constants::OK;
 }
 1;

in the "mod_perl 1.0 and 2.0 Constants Coexistence" section of:

http://perl.apache.org/docs/2.0/user/porting/compat.html#C_Apache__Constants_

Yup, in mod_perl 2.0 we should better use fully qualified constants, because now we have APR:: and Apache:: constants, hence the docs use this style everywhere. However the mp1's style works as well. Though I haven't checked whether there are any overlaps if the top level is removed.




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




Reply via email to