Return-Path: X-Original-To: apmail-perl-modperl-archive@www.apache.org Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 38B6311320 for ; Fri, 16 May 2014 22:39:06 +0000 (UTC) Received: (qmail 7097 invoked by uid 500); 16 May 2014 11:01:33 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 86403 invoked by uid 500); 16 May 2014 10:53:50 -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 55262 invoked by uid 99); 16 May 2014 10:29:41 -0000 Received: from Unknown (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 May 2014 10:29:41 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.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.229 as permitted sender) Received: from [212.85.38.229] (HELO tor.combios.es) (212.85.38.229) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 May 2014 09:09:32 +0000 Received: from [192.168.245.227] (HSI-KBW-46-237-206-233.hsi.kabel-badenwuerttemberg.de [46.237.206.233]) (Authenticated sender: andre.warnier@ice-sa.com) by tor.combios.es (Postfix) with ESMTPA id 0D8763C01EA for ; Fri, 16 May 2014 11:09:33 +0200 (CEST) Message-ID: <5375D5B4.5080509@ice-sa.com> Date: Fri, 16 May 2014 11:09:08 +0200 From: =?ISO-8859-1?Q?Andr=E9_Warnier?= Reply-To: mod_perl list User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: mod_perl list Subject: Re: API Docs References: <537401C7.3030403@gmail.com> In-Reply-To: <537401C7.3030403@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 Worik Stanton wrote: > I am still trying to fathom the API. > > I have struck a snag with the documentation. > > > https://perl.apache.org/docs/2.0/api/Apache2/Connection.html#Synopsis > says.... > > use Apache2::Connection (); > use Apache2::RequestRec (); > > my $c = $r->connection; > > > What is $r? > > I am missing something obvious, what is the context here I do not get? > Hi. Maybe you should start here : https://perl.apache.org/docs/2.0/user/handlers/intro.html#What_are_Handlers_ $r is the "current request object". How you obtain it varies a bit depending on where you are (in a mod_perl handler, in a cgi-bin script etc..). Usually, you'll be in some kind of handler() sub, and the usual idiom then is just sub handler { my $r = shift; .. } as the request object is the first and usually the only parameter passed in such a sub/method. It is also usually the starting point for everything else in mod_perl. If you are a real beginner, a recommendation : persist, you'll soon get the hang of it, and it's worth the effort. Perl is fun; Apache + mod_perl is *a lot* of fun, and incredibly powerful.