SPUG: Scope question

Peter Darley pdarley at kinesis-cem.com
Tue Jun 11 18:45:02 CDT 2002

	I see what you're pointing to, but I don't understand what it's telling me.
	Does this mean that I can get to my variable using
Apache::ROOT::MyDirectory::MyScript_2epl->Variable or somesuch?
	I'm pretty clueless about Perl namespaces...
Peter Darley

-----Original Message-----
From: Colin Meyer [mailto:cmeyer at helvella.org]
Sent: Tuesday, June 11, 2002 4:33 PM
To: Peter Darley
Subject: Re: SPUG: Scope question

Hi Peter,

On Tue, Jun 11, 2002 at 03:00:09PM -0700, Peter Darley wrote:
> Friends,
> 	I have a scope question.  I'm using mod_perl with apache, and it seems
> in my main script (the one that the URL points to) when I do 'use vars
> qw($Thing1 %Thing2)' $Thing1 and %Thing2 are not available to functions in
> modules called from the main script.  Is this just an illusion and I have
> some other problem, or is this the way things work?  If so, is there some
> way I can share a variable with modules being used by a script?

I'm assuming that you're running a traditional cgi script with
Apache::Registry, rather than a custom content handler.

The mod_perl guide will just about always come to the rescue with useful
information, and it doesn't fail now:


   Scripts under Apache::Registry do not run in package main, they run
   in a unique name space based on the requested URI. For example, if
   your URI is /perl/test.pl the package will be called


> Thanks,
> Peter Darley

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org

More information about the spug-list mailing list