Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 46119 invoked from network); 24 Aug 2007 03:11:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Aug 2007 03:11:51 -0000 Received: (qmail 20689 invoked by uid 500); 24 Aug 2007 03:11:43 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 20420 invoked by uid 500); 24 Aug 2007 03:11:42 -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 20409 invoked by uid 99); 24 Aug 2007 03:11:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Aug 2007 20:11:42 -0700 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: local policy) Received: from [210.193.32.133] (HELO mail.nexlabs.com) (210.193.32.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Aug 2007 03:12:14 +0000 Received: (qmail 60211 invoked from network); 24 Aug 2007 02:50:28 -0000 Received: from 112.210-193-15.adsl.qala.com.sg (HELO ?192.168.1.105?) (jhfoo@nexlabs.com@210.193.15.112) by www.nexlabs.com with SMTP; 24 Aug 2007 02:50:28 -0000 Message-ID: <46CE4C54.1090104@extracktor.com> Date: Fri, 24 Aug 2007 11:11:16 +0800 From: Foo JH User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 To: Perrin Harkins CC: modperl@perl.apache.org Subject: Re: Internal Server Error References: <27950181.1187752308357.JavaMail.root@elwamui-little.atl.sa.earthlink.net> <66887a3d0708231035n88a86c5p963cb7bc42b0e316@mail.gmail.com> In-Reply-To: <66887a3d0708231035n88a86c5p963cb7bc42b0e316@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hello Perrin, I'm interested in how you defined your handler with the 'method' attribute: sub handler : method { ... I've read http://perldoc.perl.org/attributes.html about attributes, but it does not seem to suggest that tagging the method attribute to subroutine has any programming advantages, unless you're interested to list the subroutines with that attribute. But I suspect there's more to it. Perhaps you can clue me in on this? Perrin Harkins wrote: > On 8/21/07, Jeff Pang wrote: > >>> PerlHandler Package::Name >>> >>> instead of: >>> >>> PerlHandler Package::Name->handler >>> >>> >> So on the first case,we need to write the handler as >> sub handler { my $r = shift; ...} >> because Apache may call the function directly as Package::Name::handler. >> >> on the second case,we write handler as, >> sub handler { my $class = shift; my $r = shift; ... } >> because '->' is a method calling. >> > > For method handlers, you also have to declare it differently. > > In mod_perl 1: > sub handler ($$) { > > In mod_perl 2: > sub handler : method { > > - Perrin >