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

Hi, I have installed the Strawberry Perl (5.10.1.3) on a Win2K3 server (clean install). I have written a perl script that uses XML::LibXML and XML::LibXSLT modules. Using the "pp" utility I converted this script to an executable and it went through fine. When I try to execute this exe, I get the following error:
Can't locate loadable object for module XML::LibXSLT in @INC (@INC con +tains: CODE(0x131a78c) C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\1\par-Admin +istrator\cache-70c420 ba58534ee4b2e162374e52ae878ff1123f\inc\lib C:\DOCUME~1\ADMINI~1\LOCALS +~1\Temp\1\par-Administrator\cache-70c420ba58534ee4b2e162374e52ae878ff +1123f\inc CODE(0xd8b1 e4) CODE(0xd8b4e4)) at C:\strawberry\perl\vendor\lib/PAR/Heavy.pm line + 103 BEGIN failed--compilation aborted at XML/LibXSLT.pm line 44.

Any suggestions on how to resolve this?

Thanks,Srini
  • Comment on Can't locate loadable module error for XML::LibXSLT on Strawberry Perl
  • Download Code

Replies are listed 'Best First'.
Re: Can't locate loadable module error for XML::LibXSLT on Strawberry Perl
by dasgar (Priest) on Aug 20, 2010 at 23:38 UTC

    I believe what happened was that when you packed the code into an executable, you didn't include the XML::LibXML module. If you check out the documentation on pp, you'll see the -M option which allows you to specify additional modules to be included in the executable. Be sure to pay attention to the caveats about the dependencies for any additional modules that you include with this option.

    If I'm correct, just add the -M option to include your module and its dependencies and it should work.

      I tried to follow your suggestion and included both XML::LibXML and XML::LibXSLT with -M option to pp. But no improvement. I get the same error.
      C:>pp -M XML::LibXML -M XML::LibXSLT -o test.exe test.pl

      Thanks,Srini

        I'm not very familiar with pp, since I haven't used it much myself. However, I think what might be happening is that your Perl environment is looking in some places for Perl modules that pp apparently is not.

        Try to locate the LibXSLT.pm file on your system. It should be somewhere under the directory that Perl was installed into. Based on your error message, it will be in a folder named XML. The folder that the XML folder is in should have some other folders and possibly some .pm files too from other modules. This folder's full path is the path that you need to tell pp to include in it's search path for modules by using the -I (or --lib) option.

        One more quick note. Hopefully that path does not have any blank spaces in a folder/directory name. If it does, you'll probably need to encapsulate the path in double-quotes.

        Hopefully, this should fix your problem. By the way, have you tested the script itself? If not, you should do so. I don't believe that the module that you're trying to use is a core module. If it wasn't bundled in the Strawberry Perl distribution, you'll need to install it. (If you can't find the LibXSLT.pm file on your system, that's a good indication that you don't have the module installed.)