With the PerlModule/%INC problem recently being rehashed, here's another one involving PerlModule vs. use that will really bake your noodle.
Attached is a full mod_perl trace, where I hacked into perl_require_module a dump of one of my vanishing namespaces on each module load. So you can definitely see it's loading up properly. All is well until you reach the end, where it starts reloading everything, and the namespace is now completely gone. Exporter predictably throws an error at this point (since @EXPORT_OK is now undefined) and the server fails to start. OTOH, one wonders how Exporter got the call, since @ISA is gone as well. I posted this once before and got blown off -- a pox on to those who tell me to check @INC or what not. There is nothing wrong with my code or my setup -- the only change I have to make to get things working is to `use` all the PerlModule modules in startup.pl first, before they're called with PerlModule. And don't tell me to just use `use` either -- they all load up Apache config directives, so PerlModule has to be called at some point so Apache recognizes the directives. But if things were working as advertised, PerlModule would be all I need. The two obvious questions: 1) Where the fsck did everything go? 2) Why does this only emanate when stuff is loaded up via PerlModule? I mean, look at perl_require_module -- all it does is `eval "require $foo"`. Hard to go wrong there. -- Stephen Clouse <[EMAIL PROTECTED]> Senior Programmer, IQ Coordinator Project Lead The IQ Group, Inc. <http://www.theiqgroup.com/>
perl_parse args: '/dev/null' ...allocating perl interpreter...ok constructing perl interpreter...ok ok running perl interpreter...ok mod_perl: 0 END blocks encountered during server startup PerlRequire: arg=`/opt/apache/conf/mod_perl.startup.pl' attempting to require `/opt/apache/conf/mod_perl.startup.pl' loading perl module 'Apache'...Dump of IQGroup::Core::Utility namespace: $VAR1 = {}; loading perl module 'Apache::Constants::Exports'...Dump of IQGroup::Core::Utility namespace: $VAR1 = {}; ok ok PerlModule: arg='IQGroup' loading perl module 'IQGroup'...Dump of IQGroup::Core::Utility namespace: $VAR1 = {}; fetching PerlChildInitHandler stack PerlChildInitHandler handlers stack undef, creating pushing CODE ref into `PerlChildInitHandler' handlers ok loading perl module 'Apache'...Dump of IQGroup::Core::Utility namespace: $VAR1 = { 'import' => *IQGroup::Core::Utility::import, 'EXPORT_FAIL' => *IQGroup::Core::Utility::EXPORT_FAIL, 'iqsprintf' => *IQGroup::Core::Utility::iqsprintf, 'is_spider_or_bot' => *IQGroup::Core::Utility::is_spider_or_bot, 'VERSION' => *IQGroup::Core::Utility::VERSION, 'ISA' => *IQGroup::Core::Utility::ISA, 'EXPORT' => *IQGroup::Core::Utility::EXPORT, 'commify' => *IQGroup::Core::Utility::commify, 'htmlize_nowrap' => *IQGroup::Core::Utility::htmlize_nowrap, 'htmlize' => *IQGroup::Core::Utility::htmlize, 'EXPORT_OK' => *IQGroup::Core::Utility::EXPORT_OK, 'BEGIN' => *IQGroup::Core::Utility::BEGIN, 'EXPORT_TAGS' => *IQGroup::Core::Utility::EXPORT_TAGS }; ok PerlModule: arg='IQGroup::IQCoordinator' loading perl module 'IQGroup::IQCoordinator'...Dump of IQGroup::Core::Utility namespace: $VAR1 = { 'import' => *IQGroup::Core::Utility::import, 'EXPORT_FAIL' => *IQGroup::Core::Utility::EXPORT_FAIL, 'iqsprintf' => *IQGroup::Core::Utility::iqsprintf, 'is_spider_or_bot' => *IQGroup::Core::Utility::is_spider_or_bot, 'VERSION' => *IQGroup::Core::Utility::VERSION, 'ISA' => *IQGroup::Core::Utility::ISA, 'EXPORT' => *IQGroup::Core::Utility::EXPORT, 'commify' => *IQGroup::Core::Utility::commify, 'htmlize_nowrap' => *IQGroup::Core::Utility::htmlize_nowrap, 'htmlize' => *IQGroup::Core::Utility::htmlize, 'EXPORT_OK' => *IQGroup::Core::Utility::EXPORT_OK, 'BEGIN' => *IQGroup::Core::Utility::BEGIN, 'EXPORT_TAGS' => *IQGroup::Core::Utility::EXPORT_TAGS }; ok loading perl module 'Apache'...Dump of IQGroup::Core::Utility namespace: $VAR1 = { 'import' => *IQGroup::Core::Utility::import, 'EXPORT_FAIL' => *IQGroup::Core::Utility::EXPORT_FAIL, 'iqsprintf' => *IQGroup::Core::Utility::iqsprintf, 'is_spider_or_bot' => *IQGroup::Core::Utility::is_spider_or_bot, 'VERSION' => *IQGroup::Core::Utility::VERSION, 'ISA' => *IQGroup::Core::Utility::ISA, 'EXPORT' => *IQGroup::Core::Utility::EXPORT, 'commify' => *IQGroup::Core::Utility::commify, 'htmlize_nowrap' => *IQGroup::Core::Utility::htmlize_nowrap, 'htmlize' => *IQGroup::Core::Utility::htmlize, 'EXPORT_OK' => *IQGroup::Core::Utility::EXPORT_OK, 'BEGIN' => *IQGroup::Core::Utility::BEGIN, 'EXPORT_TAGS' => *IQGroup::Core::Utility::EXPORT_TAGS }; ok PerlModule: arg='IQGroup::IQCoordinator::OWPSOAPServer' loading perl module 'IQGroup::IQCoordinator::OWPSOAPServer'...Dump of IQGroup::Core::Utility namespace: $VAR1 = { 'import' => *IQGroup::Core::Utility::import, 'EXPORT_FAIL' => *IQGroup::Core::Utility::EXPORT_FAIL, 'iqsprintf' => *IQGroup::Core::Utility::iqsprintf, 'is_spider_or_bot' => *IQGroup::Core::Utility::is_spider_or_bot, 'VERSION' => *IQGroup::Core::Utility::VERSION, 'ISA' => *IQGroup::Core::Utility::ISA, 'EXPORT' => *IQGroup::Core::Utility::EXPORT, 'commify' => *IQGroup::Core::Utility::commify, 'htmlize_nowrap' => *IQGroup::Core::Utility::htmlize_nowrap, 'htmlize' => *IQGroup::Core::Utility::htmlize, 'EXPORT_OK' => *IQGroup::Core::Utility::EXPORT_OK, 'BEGIN' => *IQGroup::Core::Utility::BEGIN, 'EXPORT_TAGS' => *IQGroup::Core::Utility::EXPORT_TAGS }; ok loading perl module 'Apache'...Dump of IQGroup::Core::Utility namespace: $VAR1 = { 'import' => *IQGroup::Core::Utility::import, 'EXPORT_FAIL' => *IQGroup::Core::Utility::EXPORT_FAIL, 'iqsprintf' => *IQGroup::Core::Utility::iqsprintf, 'is_spider_or_bot' => *IQGroup::Core::Utility::is_spider_or_bot, 'VERSION' => *IQGroup::Core::Utility::VERSION, 'ISA' => *IQGroup::Core::Utility::ISA, 'EXPORT' => *IQGroup::Core::Utility::EXPORT, 'commify' => *IQGroup::Core::Utility::commify, 'htmlize_nowrap' => *IQGroup::Core::Utility::htmlize_nowrap, 'htmlize' => *IQGroup::Core::Utility::htmlize, 'EXPORT_OK' => *IQGroup::Core::Utility::EXPORT_OK, 'BEGIN' => *IQGroup::Core::Utility::BEGIN, 'EXPORT_TAGS' => *IQGroup::Core::Utility::EXPORT_TAGS }; ok PerlModule: arg='IQGroup::IQDeveloper' loading perl module 'IQGroup::IQDeveloper'...Dump of IQGroup::Core::Utility namespace: $VAR1 = { 'import' => *IQGroup::Core::Utility::import, 'EXPORT_FAIL' => *IQGroup::Core::Utility::EXPORT_FAIL, 'iqsprintf' => *IQGroup::Core::Utility::iqsprintf, 'is_spider_or_bot' => *IQGroup::Core::Utility::is_spider_or_bot, 'VERSION' => *IQGroup::Core::Utility::VERSION, 'ISA' => *IQGroup::Core::Utility::ISA, 'EXPORT' => *IQGroup::Core::Utility::EXPORT, 'commify' => *IQGroup::Core::Utility::commify, 'htmlize_nowrap' => *IQGroup::Core::Utility::htmlize_nowrap, 'htmlize' => *IQGroup::Core::Utility::htmlize, 'EXPORT_OK' => *IQGroup::Core::Utility::EXPORT_OK, 'BEGIN' => *IQGroup::Core::Utility::BEGIN, 'EXPORT_TAGS' => *IQGroup::Core::Utility::EXPORT_TAGS }; ok loading perl module 'Apache'...Dump of IQGroup::Core::Utility namespace: $VAR1 = { 'import' => *IQGroup::Core::Utility::import, 'EXPORT_FAIL' => *IQGroup::Core::Utility::EXPORT_FAIL, 'iqsprintf' => *IQGroup::Core::Utility::iqsprintf, 'is_spider_or_bot' => *IQGroup::Core::Utility::is_spider_or_bot, 'VERSION' => *IQGroup::Core::Utility::VERSION, 'ISA' => *IQGroup::Core::Utility::ISA, 'EXPORT' => *IQGroup::Core::Utility::EXPORT, 'commify' => *IQGroup::Core::Utility::commify, 'htmlize_nowrap' => *IQGroup::Core::Utility::htmlize_nowrap, 'htmlize' => *IQGroup::Core::Utility::htmlize, 'EXPORT_OK' => *IQGroup::Core::Utility::EXPORT_OK, 'BEGIN' => *IQGroup::Core::Utility::BEGIN, 'EXPORT_TAGS' => *IQGroup::Core::Utility::EXPORT_TAGS }; ok PerlModule: arg='IQGroup::IQDeveloper::Administrator' loading perl module 'IQGroup::IQDeveloper::Administrator'...Dump of IQGroup::Core::Utility namespace: $VAR1 = { 'import' => *IQGroup::Core::Utility::import, 'EXPORT_FAIL' => *IQGroup::Core::Utility::EXPORT_FAIL, 'iqsprintf' => *IQGroup::Core::Utility::iqsprintf, 'is_spider_or_bot' => *IQGroup::Core::Utility::is_spider_or_bot, 'VERSION' => *IQGroup::Core::Utility::VERSION, 'ISA' => *IQGroup::Core::Utility::ISA, 'EXPORT' => *IQGroup::Core::Utility::EXPORT, 'commify' => *IQGroup::Core::Utility::commify, 'htmlize_nowrap' => *IQGroup::Core::Utility::htmlize_nowrap, 'htmlize' => *IQGroup::Core::Utility::htmlize, 'EXPORT_OK' => *IQGroup::Core::Utility::EXPORT_OK, 'BEGIN' => *IQGroup::Core::Utility::BEGIN, 'EXPORT_TAGS' => *IQGroup::Core::Utility::EXPORT_TAGS }; ok perl_cmd_setenv: 'ORACLE_HOME' = '/opt/oracle/app/oracle/product/9.0.1' init `PerlHandler' stack perl_cmd_push_handlers: @PerlHandler, 'IQGroup::IQCoordinator' pushing `IQGroup::IQCoordinator' into `PerlHandler' handlers blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) init `PerlHandler' stack perl_cmd_push_handlers: @PerlHandler, 'IQGroup::IQCoordinator' pushing `IQGroup::IQCoordinator' into `PerlHandler' handlers blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) init `PerlHandler' stack perl_cmd_push_handlers: @PerlHandler, 'IQGroup::IQCoordinator::OWPSOAPServer' pushing `IQGroup::IQCoordinator::OWPSOAPServer' into `PerlHandler' handlers init `PerlHandler' stack perl_cmd_push_handlers: @PerlHandler, 'IQGroup::IQDeveloper' pushing `IQGroup::IQDeveloper' into `PerlHandler' handlers blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) blessing cmd_parms=(0xbffff9dc) init `PerlHandler' stack perl_cmd_push_handlers: @PerlHandler, 'IQGroup::IQDeveloper::Administrator' pushing `IQGroup::IQDeveloper::Administrator' into `PerlHandler' handlers looking for method DIR_MERGE in package `IQGroup' calling IQGroup->DIR_MERGE looking for method DIR_MERGE in package `IQGroup' calling IQGroup->DIR_MERGE looking for method DIR_MERGE in package `IQGroup' calling IQGroup->DIR_MERGE loading perl module 'Apache'...Dump of IQGroup::Core::Utility namespace: $VAR1 = { 'import' => *IQGroup::Core::Utility::import, 'EXPORT_FAIL' => *IQGroup::Core::Utility::EXPORT_FAIL, 'iqsprintf' => *IQGroup::Core::Utility::iqsprintf, 'is_spider_or_bot' => *IQGroup::Core::Utility::is_spider_or_bot, 'VERSION' => *IQGroup::Core::Utility::VERSION, 'ISA' => *IQGroup::Core::Utility::ISA, 'EXPORT' => *IQGroup::Core::Utility::EXPORT, 'commify' => *IQGroup::Core::Utility::commify, 'htmlize_nowrap' => *IQGroup::Core::Utility::htmlize_nowrap, 'htmlize' => *IQGroup::Core::Utility::htmlize, 'EXPORT_OK' => *IQGroup::Core::Utility::EXPORT_OK, 'BEGIN' => *IQGroup::Core::Utility::BEGIN, 'EXPORT_TAGS' => *IQGroup::Core::Utility::EXPORT_TAGS }; ok perl_startup: perl aleady running...ok loading perl module 'Apache'...Dump of IQGroup::Core::Utility namespace: $VAR1 = { 'import' => *IQGroup::Core::Utility::import, 'EXPORT_FAIL' => *IQGroup::Core::Utility::EXPORT_FAIL, 'iqsprintf' => *IQGroup::Core::Utility::iqsprintf, 'is_spider_or_bot' => *IQGroup::Core::Utility::is_spider_or_bot, 'VERSION' => *IQGroup::Core::Utility::VERSION, 'ISA' => *IQGroup::Core::Utility::ISA, 'EXPORT' => *IQGroup::Core::Utility::EXPORT, 'commify' => *IQGroup::Core::Utility::commify, 'htmlize_nowrap' => *IQGroup::Core::Utility::htmlize_nowrap, 'htmlize' => *IQGroup::Core::Utility::htmlize, 'EXPORT_OK' => *IQGroup::Core::Utility::EXPORT_OK, 'BEGIN' => *IQGroup::Core::Utility::BEGIN, 'EXPORT_TAGS' => *IQGroup::Core::Utility::EXPORT_TAGS }; ok cmd_cleanup: SvREFCNT($IQGroup::$obj) == 1 cmd_cleanup: SvREFCNT($IQGroup::$obj) == 1 cmd_cleanup: SvREFCNT($IQGroup::$obj) == 1 cleanup_sv: SvREFCNT(0xcec6c08)==1 cmd_cleanup: SvREFCNT($IQGroup::$obj) == 1 cmd_cleanup: SvREFCNT($IQGroup::$obj) == 1 cleanup_sv: SvREFCNT(0xcec6b3c)==1 cleanup_sv: SvREFCNT(0xcec63a0)==1 cmd_cleanup: SvREFCNT($IQGroup::$obj) == 1 cmd_cleanup: SvREFCNT($IQGroup::$obj) == 1 cleanup_sv: SvREFCNT(0xcecec30)==1 cmd_cleanup: SvREFCNT($IQGroup::$obj) == 1 cmd_cleanup: SvREFCNT($IQGroup::$obj) == 1 cleanup_sv: SvREFCNT(0xbe89038)==1 loading perl module 'Apache'...Dump of IQGroup::Core::Utility namespace: $VAR1 = {}; ok PerlRequire: arg=`/opt/apache/conf/mod_perl.startup.pl' attempting to require `/opt/apache/conf/mod_perl.startup.pl' loading perl module 'Apache'...Dump of IQGroup::Core::Utility namespace: $VAR1 = {}; ok PerlModule: arg='IQGroup' loading perl module 'IQGroup'...Dump of IQGroup::Core::Utility namespace: $VAR1 = {}; "htmlize_nowrap" is not exported by the IQGroup::Core::Utility module at /home/thebrain/perllib/IQGroup.pm line 16 not ok Syntax error on line 1216 of /opt/apache/conf/httpd.conf: Can't continue after import errors at /home/thebrain/perllib/IQGroup.pm line 16 BEGIN failed--compilation aborted at /home/thebrain/perllib/IQGroup.pm line 16. Compilation failed in require at (eval 568) line 3.
msg23434/pgp00000.pgp
Description: PGP signature