in reply to mod_perl configuration error?

The idea behind mod_perl is that your script is run several times for each time it is loaded. While this improves efficiency, it does raise some new issues.

The issue you've encountered is that when a script is executed the second time in a given fork, it keeps the old values from the first execution.

Another issue is that declaring a my variable in your script outside of any subroutines and then using it inside a subroutine will cause the warning "Variable ... will not stay shared...". This is an effect of how mod_perl caches your script, by putting it inside a subroutine. See perldiag for more details.

To solve these issues, you should:

In 5.6.0, you should be able to use our instead of use vars.