Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: CHECK and INIT under mod_perl

by stvn (Monsignor)
on Dec 12, 2004 at 17:03 UTC ( [id://414240]=note: print w/replies, xml ) Need Help??


in reply to CHECK and INIT under mod_perl

I'm wondering if there is a standard workaround that's fairly transparent to the end user? I'd rather not force them to explicitly call a setup method.

I have tried to do this same thing with Class::Trait and never managed to get it to work. And recently dragonchild and I did the same thing with Class::LazyLoad. I also think liz had a similiar issue with one of her thread modules as well. The general solution seems to be to force the use to explictly call the set up under mod_perl. To be honest, this is ugly, but has never been a big problem since it can just go in the startup.pl which I load at server startup anyway.

Since the code uses a filter, I suppose I could explicitly set up the setup call for them, but that seems rather ugly.

I don't think that seems ugly at all. It is doing what the user would expect it to do, which is what it would do under non-mod_perl circumstances. As far as I am concerned that is an elegant solution since it prevents the user from having to deal with your internals or be concerned about silly internal issues under mod_perl. It might look ugly in the code, but I don't think the perl parser will be offended :)

-stvn

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://414240]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-03-29 06:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found