At 17:30 23.03.2002 +0000, Jeff wrote:
>Just Curious of Hither Green writes:
>
>So, I am working my way through, and get to page 83 which has a little
>spellette:
>
>sub handler {
>   my $r = shift;
>   print STDERR $r->as_string();
>   return OK;
>}
>
>looks easy peasy - but
>
>1) OK ->  Bareword "OK" not allowed while "strict subs" in use
>    well, that's easy to fix - I must be missing a 'use' [which one??]
>    I assume OK is 1 - ie TRUE
>
>2) error log: Subroutine handler redefined at xxx line 1
>
>This is interesting - probably because PerlHandler Apache::Registry so
>kitchen whizzes, tell me please, exactly what knead I put in my
>httpd.conf instead of Apache::Registry?

You must have taken this subroutine out of context. There are a certain 
number of things which must appear for an Apache handler to work:

package Apache::Whatever;

You need to have that line to uniquely identify your module. If you use the 
name Apache::Whatever, your handler must be named Whatever.pm and be placed 
in your @INC search path under Apache/
This is probably the reason for your number 2 problem: you must have used 
the same package name twice. Or not used a package name at all.

use Apache::Constants;

This imports the constants like OK, DECLINED, etc... You can also specify 
them explicitly:
use Apache::Constants qw(OK DECLINED);

I hope this helps you out.

-- 

Per Einar Ellefsen
[EMAIL PROTECTED]

Reply via email to