But I've noticed that Class::Std doesn't work very well with mod_perl due to the BEGIN{} block it depends on.
Actually it is a CHECK block that is the problem. Because of the way that mod_perl loads code, it does this after the CHECK and INIT phases of the perl compiler have run. This is the code which causes the issue (about line 258 in the lastest version on CPAN):
Now, I am not sure if this version (0.0.8) works with mod_perl or not, but I did find this code on line 417:{ no warnings qw( void ); CHECK { initialize() } }
So it is possible that this version will work with mod_perl, but even if it does, then it should be possible1, to actually just put that same line of code at the very end of a mod_perl startup.pl file, and things should just work.Class::Std::initialize(); # Ensure run-time (and mod_perl) setup is +done
(1) - I stress should, because I am not TheDamian, and while I have read over the Class::Std code, I do not profess to understand all it's funky corners and details. However, logic and common sense dictate that if the CHECK block is not run, then just running the same code from the CHECK block should just work. But then again, this is TheDamian we are talking about ;)
In reply to Re: Making Class::Std work with mod_perl
by stvn
in thread Making Class::Std work with mod_perl
by Pic
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |