Subject: | Class::Std does noet work with mod_perl |
=head1 Environment:
- kernel 2.6.12-gentoo-r9 SMP
- perl 5.8.7
- apache 2.0.54
- mod_perl 2.0.1
=head1 Description:
Any "use Class::Std;" in a module that is used in a mod_perl application results in the following error:
Too late to run CHECK block at /usr/lib/perl5/site_perl/5.8.7/Class/Std.pm line 359.
Hence all modules using Class:Std, such as Config::Std also fail to work.
=head1 Explanation:
The reason is, I think, explained in "Practical mod_perl" chapter 6.5:
<quote>
The CHECK and INIT blocks run when compilation is complete, but before the program starts. [...]
Perl calls these blocks only during perl_parse( ), which mod_perl calls once at startup time. Therefore, CHECK and INIT blocks don't work in mod_perl [...]
</quote>