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 :)
-
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.
|