I'm attempting to load a configuration file right into a hash throughout my PerlChildInitHandler after which access the values from PerlResponseHandler. However, despite the fact that the procedure number is identical, it appears that variables transformed throughout the child_init() call revert to their default values when handler() will get known as.

The fundamental scenario is:

package StartupLog;

# the variable I'm testing
my $sticky = 0;

sub child_init {
    $sticky = 1;
    return 0;
}

sub handler {
    warn __PACKAGE__ . " sticky = $sticky\n";    ### always says "0" but should say "1"
    return 0;
}
1;

It was never clarified, so eventually I moved onto while using PerlPostConfigHandler, which appeared to operate acceptably. I'm able to only assume it is something concerning the forking that occurs within the PerlChildInitiHandler but, unfortunately, I threw in the towel. Hope this can help someone later on.

Generally, if you wish to load something at childinit time, and can get on within the response phase, you'd stuff it right into a package global (like $My::variable = 'lols'). I have never attempted to get it done how you are here. Have you use our rather than my maybe?.