Re: shared variable between PerlChildInitHandler and PerlResponseHandler

Mark Risher <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
Thank you for the suggestions. Unfortunately, I am still not able to make 
it work.

Spurred by your advice, I examined my apache2.conf config. Here it is:

PerlSwitches -I/mnt/hgfs/src/api    # the path where my modules live
PerlModule StartupLog
PerlChildInitHandler StartupLog::child_init
<Location /event>
    SetHandler modperl   
    PerlResponseHandler StartupLog::handler
</Location>


In answer to your questions:
> The only thing where mod_perl may stay in the way here is if you use somehow a 

> different interpreter for child_init than for handler. Do you use a threaded 
> MPM, e.g. windows? Do you use the +Parent PerlOption in a VHost?

[mr] I haven't changed the MPM, and I'm running on a Linux host. I do not have 
the +Parent option


> Otherwise, the bug is somewhere in your code. Try to answer a few questions:
> 1) is the child_init handler called?
> 2) are handler, child_init and $sticky in the same scope? Forgot "use strict"? 

> Try to print \$sticky in both handlers.

[mr] I'm getting different addresses, which illustrates the problem

2010/08/19 18:13:37 child_init &sticky = SCALAR(0x220ea748)
2010/08/19 18:13:37 child_init sticky (pre) = 0
2010/08/19 18:13:37 child_init sticky (post) = 1
...
2010/08/19 18:13:48 handler sticky (should be 1)= 0
2010/08/19 18:13:48 handler &sticky = SCALAR(0x23102e28)
 


> 3) perhaps your intend was to use a package variable (the warning you print 
> out makes me think so)
[mr] I've gone back and forth on using a package variable; the warn statement 
was a remnant.



Thanks again!
/m
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.