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 10567DE88 for ; Sun, 11 Nov 2012 19:32:34 +0000 (UTC) Received: (qmail 96948 invoked by uid 500); 11 Nov 2012 19:32:33 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 96921 invoked by uid 500); 11 Nov 2012 19:32:33 -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 96914 invoked by uid 99); 11 Nov 2012 19:32:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Nov 2012 19:32:32 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mheiges@gmail.com designates 209.85.210.177 as permitted sender) Received: from [209.85.210.177] (HELO mail-ia0-f177.google.com) (209.85.210.177) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 Nov 2012 19:32:23 +0000 Received: by mail-ia0-f177.google.com with SMTP id u21so1478295ial.22 for ; Sun, 11 Nov 2012 11:32:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=FrP2FoBvVkVyajt8WXwCFK8Hps8SOyNnppUyf+Qkibo=; b=gCEtQnhVmAUPqdZ5RMYvuVYpBvGNghWreVIfEkSnDvHQ61crBxsuPCiVnh3y5deMMr 37uTv4rPTAVx/TiEBVEoC1vq9LtaXCJwJcpqzQsg0RoeZd8AlW2TX7txltcJehymtWnb pjzZkBo49gj1PAgXMGUPmJFS+3HOH+ZjplOOgKm8FvYH/2AtxOaDz/zQEKZuYA3InN3y JnQrUmloQ6Nb45/0GV7HfxDBIF9YprtEna4X4/ROifMieP7z7zgB3Y0JsLUM5RFe20Sh ul8Z28NZpraXUjbIOzWv2Is70SgFWs84ID9ZAeGbuCrQBHd8lB6CVv4zAKOEpVHMPs8D svfw== Received: by 10.50.57.193 with SMTP id k1mr6193064igq.18.1352662322660; Sun, 11 Nov 2012 11:32:02 -0800 (PST) Received: from [10.0.0.173] (71-14-5-115.static.gwnt.ga.charter.com. [71.14.5.115]) by mx.google.com with ESMTPS id dq9sm4396654igc.5.2012.11.11.11.32.00 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 11 Nov 2012 11:32:01 -0800 (PST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Apple Message framework v1085) Subject: Re: failure using Socket in PerlSection From: Mark Heiges In-Reply-To: <509E7131.2090308@gmx.net> Date: Sun, 11 Nov 2012 14:31:58 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <5D2F7323-823D-4B07-B32D-BBC9E17C44E2@gmail.com> References: <1BF5D822-DF6D-46F2-B948-90B8EB2AFC88@gmail.com> <509E7131.2090308@gmx.net> To: modperl@perl.apache.org X-Mailer: Apple Mail (2.1085) X-Virus-Checked: Checked by ClamAV on apache.org On Nov 10, 2012, at 10:22 AM, Torsten F=F6rtsch wrote: > On 11/10/2012 03:43 PM, Mark Heiges wrote: >>=20 >> On Nov 9, 2012, at 10:36 PM, Mark Heiges wrote: >>=20 >>> I have a name-based virtual host and want to use Socket.pm in a = PerlSection: >>>=20 >>> >>> use Socket; >>> >>>=20 >>> but when starting httpd I get the error, >>>=20 >>> $parms->add_config() has failed: Invalid command 'INADDR_ANY', = perhaps misspelled or defined by a module not included in the server = configuration at /usr/lib64/perl5/Apache2/PerlSections.pm line 215.\n >>=20 >> Nevermind. I can selectively export only the symbols I need. >>=20 >> >> use Socket qw(inet_ntoa); >> >>=20 > You should also be able to >=20 > > { > package Something::That::Does::Not::Start::With::Apache2::ReadConfig; > use Socket; > } > >=20 > The point is, everything in %Apache2::ReadConfig:: is passed to the > httpd as configuration. >=20 > The default package for sections is > Apache2::ReadConfig::path::to::config::file_conf::line_NNN given the > file containing the section is /path/to/config/file.conf and = the > line following the opening directive is NNN. >=20 > Torsten Yes, that works and declaring a package is semantically cleaner in my = real-world usage. Thank you! =20