You are right. To be more precise, I am actually allocating the object on thread symbol table, but under mod_perl objects in "main" threads functions are persistent between calls. So it gets messed on subsequent calls. To avoid this it is needed to use a lexical variable, that does not allocate on the symbol table. To achieve the same behavior as per cgi environment, I should manipulate what it is called "stack scratchpad", but I do not have such skills. | [reply] |
| [reply] |
I am testing the trick also in mod_perl, under Worker MPM. So, yes, I am definitely using threads.
| [reply] |
use EXAMPLE();
my $poop = EXAMPLE->new;
$poop->my_example_method;
print "mission accomplished\n";
| [reply] [d/l] |
If you have a look at the code I posted, you can see that the trick I am testing consists actually in putting an instance of the object in the "main" namespace without using Exporter and without declaring/instantiating the object from the cgi.
In fact the class calls its own constructor when you use it.
| [reply] [d/l] |