joetesta has asked for the wisdom of the Perl Monks concerning the following question:

Greetings wise ones.

I have a complicated (to me) mod_perl system that I inherited and I'm trying to apply Apache2::compat.pm to help with the process of eliminating apache 1.
I've tried adding "PerlModule Apache2::compat" in the server conf but I keep getting
Undefined subroutine &Apache2::ServerUtil::restart_count called at /home/joe/bin_server/perl/Apache2/compat.pm line 79. Compilation failed in require at (eval 4) line 3.

I also tried putting in my startup file, "use Apache2::compat ();" but that gave me the same error.
I've tried to trace this back and I'm lost once I hit XSLoader; I've tried adding various debugging code, or creating my own "restart_count" function in ServerUtil but all to no avail.
Is there a way to print out what methods are actually loaded with the ServerUtil module in my environment?
Any suggestions as to what might be going wrong?

thank you very much in advance,
joe

Replies are listed 'Best First'.
Re: Stuck trying to implement Apache2::compat.pm
by bulk88 (Priest) on Dec 27, 2013 at 02:44 UTC
    Some generic observations since I dont do webdev, mod_perl seems to be written in mostly XS.
    perl -MData::Dumper -e "print Dumper(\%main::);"
    The sub is simply not defined. Most normal modules have subs living in typeglobs . "*Apache2::ServerUtil::restart_count{CODE}" returns a ref to a sub. You can also use Devel::Peek's Dump() command if Data::Dumper isn't detailed enough. You are probably missing a "require Foo;" or "use Foo;" somewhere. In very rare cases, one piece of code, is monkey patching, or local()izing the glob or the glob's CODE slice, and removing the sub/xsub from view permanently or temporarily. In other rare cases modules use AUTOLOAD to bring a sub into existence the first time it is called.
Re: Stuck trying to implement Apache2::compat.pm (2007)
by Anonymous Monk on Dec 27, 2013 at 02:58 UTC
      on this archaic system we're currently running both mod_perl 2 (2.0.4) alongside mod_perl 1 and my thought is to get rid of 1 and go from there. Initially tried upgrading to mod_perl 2.0.8 but the configure options seemed to have changed entirely so I backed away from that. But from your question it sounds like I should move forward there first. thanks for your reply.