You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Sean C. Brady" <se...@valueclick.com> on 2001/03/14 01:58:33 UTC

Re: Handler without handler()

Gene Dascher wrote:
> 
> I have a handler that I want to contain all of my methods for access
> control, authentication and authorization.  I have created the file with 3
> different methods named access($$), authentication($$) and
> authorization($$).  I have these methods set up thusly in the httpd.conf
> file:
> 
> <Directory /usr/local/cgi-bin>
>         PerlHandler Apache::Registry
>         AuthType Me::MyHandler
>         AuthName Me
>         PerlAccessHandler Me::MyHandler->access
>         PerlAuthenHandler Me::MyHandler->authenticate
>         PerlAuthzHandler Me::MyHandler->authorize
>         PerlInitHandler Apache::StatINC
>         PerlSetVar StatINCDebug On
>         require valid-user
> </Directory>
> 
> Unfortunately, every time I try and access a cgi in that directory, I get
> the following errors:
> 
> Can't locate object method "access" via package "Me::MyHandler"
> access.pm: Can't locate access.pm in @INC
> 
> So I have a couple of questions:

> 1) Can I write a handler that doesn't have a method named 'handler'?

Yes, you can write a handler that doesn't have a sub named 'handler'.

> 2) If so, what do I have to put in the httpd.conf file to allow Apache to
> properly access the handler methods?

I believe you need to specify the subroutine.  Otherwise the handler sub
is assumed.

> 
> Thanks,
> 
> Gene Dascher

~Sean