Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 76381 invoked from network); 12 Feb 2009 18:59:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Feb 2009 18:59:09 -0000 Received: (qmail 6957 invoked by uid 500); 12 Feb 2009 18:59:04 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 6938 invoked by uid 500); 12 Feb 2009 18:59:04 -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 6929 invoked by uid 99); 12 Feb 2009 18:59:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Feb 2009 10:59:04 -0800 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of adam.prime@utoronto.ca does not designate 216.220.44.220 as permitted sender) Received: from [216.220.44.220] (HELO mail.oanda.com) (216.220.44.220) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Feb 2009 18:58:57 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.oanda.com (Postfix) with ESMTP id 6B8F2EC017; Thu, 12 Feb 2009 13:58:36 -0500 (EST) Received: from mail.oanda.com ([127.0.0.1]) by localhost (mail.q9.oanda.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 21258-02; Thu, 12 Feb 2009 13:58:36 -0500 (EST) Received: from gateway.oanda.com (eddie.dev.oanda.com [10.1.1.10]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.oanda.com (Postfix) with ESMTPS id 54D9AEC013; Thu, 12 Feb 2009 13:58:36 -0500 (EST) Received: from [10.1.5.118] (primepc.dev.oanda.com [10.1.5.118]) by eddie.dev.oanda.com (Postfix) with ESMTP id 410BA3072F; Thu, 12 Feb 2009 13:58:36 -0500 (EST) Message-ID: <4994715B.4010603@utoronto.ca> Date: Thu, 12 Feb 2009 13:58:35 -0500 From: Adam Prime User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: erik@q32.com CC: modperl@perl.apache.org Subject: Re: WELCOME to modperl@perl.apache.org References: <1234451326.8429.ezmlm@perl.apache.org> <49944A35.7020907@plusthree.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Erik Aronesty wrote: >> Maybe ModPerl::Registry should do this, but not mod_perl itself. If someone > > Yes, it's a problem with ModPerl::Registry, I agree. It's not mentioned here: > > http://perl.apache.org/docs/2.0/api/ModPerl/Registry.html#Caveats > > Where it should be. Absolutely, i'll patch the docs to add a link to the perl reference page over the weekend. >> is trying to get an old CGI script to work under mod_perl then they'd use >> Registry. But there's no reason to make the rest of us suffer for their old >> scripts. > > # This isn't an "old" program...it's a simple program, > # and no amount of "strict or warnings" will help debug it > > use CGI; > my $x =CGI::param('foo'); > > &y; > > sub y { > print "content-type:text/plain\n\n?$x\n"; > } If you add use strict and use warnings to that script, you get this in your error_log: Variable "$x" will not stay shared at /usr/local/prefork/perl/thing.cgi line 10. which, with a quick googling of 'mod_perl variable will not stay shared', turns you to a number of resources talking about the problem, and it's solutions. And for what it's worth, it seems that running under ModPerl::PerlRun makes it work alright, albeit with 2 warnings in the error_log: Variable "$x" will not stay shared at /usr/local/prefork/perl/haha.cgi line 10. Subroutine y redefined at /usr/local/prefork/perl/haha.cgi line 9. Adam