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.
[...]
Here is the code:
BEGIN {
if (MP2) {
require Apache::Const;
require Apache::Access;
require Apache::Connection;
require Apache::Log;
require Apache::RequestRec;
require Apache::RequestUtil;
Apache::Const->import(-compile => 'HTTP_UNAUTHORIZED','OK');
} else {
require Apache::Constants;
Apache::Constants->import('HTTP_UNAUTHORIZED','OK');
}
}(Or, variations upon it...) As I've said, though, my code is dying with an error on Apache::Constants anymore.... If I hit it again, I will post the error message that I was getting.
thanks, speeves cws
