brent.allsop has asked for the wisdom of the Perl Monks concerning the following question:

Hey Monks,
I’m trying to create a wiki system with Apache2 ASP and PurpleWiki. It’s currently working on one server (older version of Cent OS) I’m trying to get it up on a newer fedora 7 system but I’m getting this error from the Apache started starup.pl script:
[Wed Aug 22 19:19:23 2007] [error] Undefined subroutine &XSLoader::loa +d called at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/APR/XSLoa +der.pm line 31. Compilation failed in require at /usr/lib/perl5/site_perl/5.8.8/Apache/compat.pm line 50. BEGIN failed--compilation aborted at /usr/lib/perl5/site_perl/5.8.8/Ap +ache/compat.pm line 50. Compilation failed in require at /etc/httpd/conf/startup.pl line 20. BEGIN failed--compilation aborted at /etc/httpd/conf/startup.pl line 2 +0. Compilation failed in require at (eval 2) line 1. [Wed Aug 22 19:19:23 2007] [error] Can't load Perl file: /etc/httpd/conf/startup.pl for server c-71-195-247-134.hsd1.ut.comcast +.net:0, exiting...
I don’t understand what could be causing this.
The only thing in XSLoader.pm is the code below. Why does this sub load appear to call itself with XSLoader::Load, Yet the error claims it is undefined on this statement line???
package APR::XSLoader; use strict; use warnings FATAL => 'all'; use XSLoader (); BEGIN { unless (defined &BOOTSTRAP) { *BOOTSTRAP = sub () { 0 }; } } sub load { return unless BOOTSTRAP; XSLoader::load(@_); # this is line 31 where the undefin +ed occurs. } 1; __END__

Replies are listed 'Best First'.
Re: XSLoad::load calls itself?
by Errto (Vicar) on Aug 29, 2007 at 03:14 UTC
    The module where you're seeing the problem is called APR::XSLoader. The module the error is being reported about is called XSLoader. They're two different modules, not related except that one apparently depends on the other. If you don't have XSLoader installed on your machine, you can get it from CPAN.

      Good point.

      Since the "use XSLoader ();" statement isn't dieing, I suspect XSLoader is already loaded (it is also a core module).

      Oh! I just had an idea. One simple explanation would be if @INC included "/usr/lib64­/perl5/ven­dor_perl/5­.8.8/x86_6­4-linux-th­read-multi­/APR" before the path where the XSLoader module is. Then "use XSLoader ();" would load the XSLoader.pm from the APR::XSLoader module.

      Note that @INC should not contain "/usr/lib64­/perl5/ven­dor_perl/5­.8.8/x86_6­4-linux-th­read-multi­/APR" at all.

      So the next step I'd recomment is reporting the value of $INC{"XSLoader.pm"}.

      - tye        

        Folks, Oh, XSLoader and APR::XSLoader are different. That explains a lot. I did a cpan install of XSLoader, and evidently I didn’t have that since it installed right? But it is still getting the same undefined XSLoader::load error.
        You can’t do a print of $INC{"XSLoader.pm"} since it doesn’t compile right? But I did a use glip::wad; in startup.pl to cause the below error dump of @INC:
        But there is no APR anywhere in there right? It must be getting it some where since, as you said, the use XSLoader is not dieing right, even before I installed it?
        So this $INC{"XSLoader.pm"} doesn’t really work right? Since INC is an array? How do you find out what value it is finding and using?
        Thanks
        Brent Allsop
        @INC (@INC contains: /usr/local/webtools /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/Apache2 / +usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/Bundle /u +sr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/p +erl5/site_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/ +perl5/site_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib64/per +l5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.7/x86_64-linux-thread-multi /usr/lib6 +4/perl5/vendor_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/ +perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr +/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 +. /etc/httpd)
Re: XSLoad::load calls itself?
by Anonymous Monk on Aug 29, 2007 at 03:16 UTC
    APR::XSLoader and XSLoader are two distinct modules