Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 79653 invoked from network); 27 Sep 2010 08:55:47 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 Sep 2010 08:55:47 -0000 Received: (qmail 80414 invoked by uid 500); 27 Sep 2010 08:55:46 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 80213 invoked by uid 500); 27 Sep 2010 08:55:43 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 80206 invoked by uid 99); 27 Sep 2010 08:55:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Sep 2010 08:55:42 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of aw@ice-sa.com designates 212.85.38.228 as permitted sender) Received: from [212.85.38.228] (HELO tor.combios.es) (212.85.38.228) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Sep 2010 08:55:33 +0000 Received: from [192.168.245.129] (p549E8943.dip0.t-ipconnect.de [84.158.137.67]) by tor.combios.es (Postfix) with ESMTPA id 3298B2262BD for ; Mon, 27 Sep 2010 10:51:58 +0200 (CEST) Message-ID: <4CA05BE3.903@ice-sa.com> Date: Mon, 27 Sep 2010 10:54:59 +0200 From: =?ISO-8859-1?Q?Andr=E9_Warnier?= Reply-To: mod_perl list User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: mod_perl list Subject: Re: Using a handler other than 'handler' References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Hi. You can use PerlAuthenhandler Your::Module->special See http://perl.apache.org/docs/2.0/user/coding/coding.html#Techniques C�dric Bertolini wrote: > @Michel, > > Thanks for the reply. As far as I know, Apache2::RequestRec is a module that > provides several functions to manage the $request object provided by > mod_perl (http://perl.apache.org/docs/2.0/api/Apache2/RequestRec.html). It's > not really a handler, though most handlers use this module one way or > another. I just want to use a different handler than usual, but from the > same file, If that's possible. > > @Nico > > Thanks for the reply. Deciding on a behavior based on $r->uri or > $r->filename in the handler is what I was doing previously, but I'd love to > have a solution based the config file instead of the handler itself, for > robustness. I will have to stick to this solution if mod_perl doesn't let me > provide the name of the handler, though. > > > > 2010/9/27 Nico Coetzee > >> I had a similar requirement. My solution: based on the value of $r->uri() I >> would call the different subs from the main handler() sub. All the other >> subs take $r as the first argument and then the rest of the parameters >> follow. >> >> Probably not the best solution, but it worked for me. >> >> Cheers >> >> Nico >> >> 2010/9/27 C�dric Bertolini >> >> Hello, >>> I apologize for such a trivial question, but I'd like to use a function >>> other than "handler" as a perl handler. According to the doc, it was >>> possible in mod_perl 1, but I can't manage to get it to work under mod_perl >>> 2. >>> >>> >>> Here is an example of my code: >>> >>> file Authen.pm >>> >>>> sub handler { >>>> // regular handling >>>> } >>>> >>>> sub special { >>>> // special case >>>> } >>> file httpd.conf >>> >>>> >>>> PerlAuthenHandler /lib/Authen >>>> >>>> >>>> # I want to override the regular case by using "special" instead of >>> "handler" in /lib/Authen.pm >>>> >>> Thanks in advance, >>> C�dric Bertolini >>> >>> >