-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
[EMAIL PROTECTED] schrieb: | In trying to develop a simple perl script, I have run into some kind of | caching problem which is making development an absolute nightmare. | | The problem arises when I am using a subroutine. Whilst developing the | subroutine, I (obviously) make errors in the code! I try the script out in | the browser and get an error message, as you would expect. So then I | revert the code back to what it was when it was working... try it in the | browser again just to check, and I get an error message once again... | strange, I just reverted the code back to what it was when I knew it was | working.! | | Sometimes, if I click refresh several times, it may suddenly decide to | start working again. I can force it to work properly again by renaming the | subroutine! Another way I can force it to start working again is to | restart apache! | | When the code is in such a state that I know for a fact it should be | working, and the browser gives me an error... I can run the script | successfully from the command line!!! | | anyone ever had this (or a similar) problem????!! |
That's not a problem its more a feature of mod-perl. Don't forget the code you write gets compiled only once per-apache-process/thread.
The following happens:
apache_ctl restart 1. request => handled by apache-child 1 => (no code loaded) compile code (code_1) => execute code => produces an error revoke changes 2. request => handled by apache-child 1 => execute code => produces an error
3. request => handled by apache-child 2 => (no code loaded) compile code (code_1) => execute code => successful
In short child1 and child2 have different versions of code and won't recompile until you say them to do so.
2 ways out: - ----------- - - always restart apache when files changed - - use Apache::Reload/Apache2::Reload
Tom -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCbnPokVPeOFLgZFIRAj0rAJ9l7rCYzXmQSTb4Zq/sBnPoVuFAyACfSZ2K DXiphq+FU958J3Zf32Er4l8= =p5kr -----END PGP SIGNATURE-----