note
Jeppe
Hmm. It's never that easy.
<p>
As it turns out, DProf segfaults while Devel::Profiler screws up the file when confronted with my scary class definition logic. What I'm doing is VERY insecure, so only do this if you TRUST your users.
<p>
I've designed it so that one general class is a shell around the class I load. I've done this for several reasons
<ol>
<li>If there is a syntax error in one of the classes, I don't want bring down the entire process.</li>
<li>I want to give my customers the chance to create their own code that ties in, without altering the core code</li>
<li>I got a performance improvement when using this method over regular inheritance</li>
</ol>
Anyhow, I have a class. The objects have an associated file, and that file contains part of the code - using a standard API. So, I create a header and a footer, and insert the code from the file inbetween. Then, I run a string eval around that, and then I have a new child class. I create an object of the child class, and keep it as a variable in the parent class. Inside the parent class, I call that object where appropriate.
<p>
As it turns out, the profilers do not approve of this.
<p>
Any brilliant ideas, fellow monks? Need I rewrite, or do you see a way for me to work around my problem?
226544
226569