ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> modperl
modperl
Re: mod_perl 2.0 globals question
by Stas Bekman other posts by this author
May 29 2004 3:57AM messages near this date
Re: mod_perl 2.0 globals question | Re: mod_perl 2.0 globals question
Nathanial P. Hendler wrote:
>  Yes, I'd read that section several times before posting.  I understand
>  that the setting is enabled at some points, disabled at others, and can be
>  enabled.  I don't have an old version if CGI.pm, and I don't understand
>  what that has to do with anything.  It seems to do more than just setup
>  the global $r object, since it changes the way all my globals behave.
>  
>  I'd like to know if people want access to $r in their modules, and if so,
>  do they pass their modules $r, or do they turn on GlobalRequest, and is it
>  a sane thing to do?

the best and the safest approach is to pass it around.

You could also use a Singleton. There are a few of them on CPAN and there is 
one example how to write your own in the "Practical mod_perl" book.

>  On Fri, 28 May 2004, Stas Bekman wrote:
>  
>  
> >Nathanial P. Hendler wrote:
> >[...]
> >
> >>What does GlobalRequest do
> >>exactly, and is there a better way to get Apache->request in modules?
> >
> >http://perl.apache.org/docs/2.0/user/config/config.html#C_GlobalRequest_
> >
> >


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------>  Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide --->  http://perl.apache.org
mailto:stas@[...].org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
Thread:
Nathanial P. Hendler
Nathanial P. Hendler
Stas Bekman
Nathanial P. Hendler
Stas Bekman
Tom Schindl
Tom Schindl
Tom Schindl

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved