perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Rolsky <auta...@urth.org>
Subject Re: passing an object to a handler
Date Wed, 02 Oct 2002 20:11:53 GMT
On Wed, 2 Oct 2002, william ross wrote:

> sorry: i wasn't very clear, was I? I am using a method handler, but I
> want to pass an object of another class to it each time it is called.
> The object needs to be created outside of an individual request, and
> therefore presumably in a startup file, and then either passed to the
> handler along with each request, or somehow made available to all the
> requests, but preferably without setting a class variable, which is
> what I do at the moment but dislike.

You could make the other object a singleton, so you could just do:

  my $factory = My::Factory->instance

in your handler subroutine and it'd get the already created object.


-dave

/*==================
www.urth.org
we await the New Sun
==================*/


Mime
View raw message