perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Hedges <>
Subject Re: tUsing module
Date Sun, 01 Mar 2009 23:17:03 GMT

On Fri, 27 Feb 2009, Justin Wyllie wrote:

> I want to instantiate an object just once in the lifetime
> of a script, not on every request.   I'm used to Mason
> where you can use Mason's <%once> block.   In mod_perl
> proper would the equivalent be to instantiate it in a
> BEGIN block? But it would need to be in scope for  the
> whole script..

You are using straight CGI, or using ModPerl::Registry?

If using registry, you should be able to instantiate the
object just by putting it in package scope (anywhere.)
Same is true for a proper handler.

If using straight CGI, you probably can't do this, because
the interpreter gets started up fresh for every hit to the

  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message