Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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

In reply to Re: CHECK and INIT under mod_perl by stvn
in thread CHECK and INIT under mod_perl by Ovid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2024-03-28 18:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found