perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Per Einar Ellefsen <>
Subject Re: passing an object to a handler
Date Wed, 02 Oct 2002 19:18:12 GMT
At 20:47 02.10.2002, william ross wrote:
>I've been off-list for a while, so please forgive (and direct) me if this 
>is a tired subject.
>In short, i'd like to pass through another object on method invocation, in 
>addition to the apache request. Ideally the (method)handler would look 
>something like:
>sub handler ($$$) {
>         my ($class, $r, $factory) = @_;
>         ...
>where $factory is an object I made earlier, and is shared among all the 
>requests. I'd like to avoid class data because the handler will almost 
>always be subclassed, and anyway it makes me nervous. And for the same 
>reason I don't want to make the factory a singleton: each single, 
>hard-working object of the factory class will have a different configuration.
>but I can't find anything to tell me how to do it. I feel sure I'm missing 
>something really obvious here?

You can configure objects instead of using static class names. See the doc:

Per Einar Ellefsen

View raw message