in reply to Can't locate loadable module error for XML::LibXSLT on Strawberry Perl

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.

  • Comment on Re: Can't locate loadable module error for XML::LibXSLT on Strawberry Perl

Replies are listed 'Best First'.
Re^2: Can't locate loadable module error for XML::LibXSLT on Strawberry Perl
by srinimg (Initiate) on Aug 20, 2010 at 23:57 UTC
    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.)

        LibXML/LibXSLT comes with strawberryperl 5.12

        If you use

        unzip -d test test.exe
        you can see exactly every file that was packed (you could get similar list with verbose option ( pp -v)

        For me using

        use XML::LibXSLT; print `Listdlls.exe $$`; # sysinternals.com
        shows plenty of files files that pp doesn't pack, that you have to add manually . Its all the files outside of the perl directory, namely lib*xsl* , as usually you can ignore the \WINDOWS files
        Base Size Version Path 0x00400000 0xa000 D:\strawberry\perl\bin\perl.ex +e 0x7c900000 0xb2000 5.01.2600.5755 C:\WINDOWS\system32\ntdll.dll 0x7c800000 0xf6000 5.01.2600.5781 C:\WINDOWS\system32\kernel32.d +ll 0x68a40000 0x157000 D:\strawberry\perl\bin\perl512 +.dll 0x77dd0000 0x9b000 5.01.2600.5755 C:\WINDOWS\system32\ADVAPI32.D +LL 0x77e70000 0x92000 5.01.2600.5795 C:\WINDOWS\system32\RPCRT4.dll 0x77fe0000 0x11000 5.01.2600.5834 C:\WINDOWS\system32\Secur32.dl +l 0x773d0000 0x103000 6.00.2900.5512 C:\WINDOWS\WinSxS\x86_Microsof +t.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce8 +3\COMCTL32.DLL 0x77c10000 0x58000 7.00.2600.5512 C:\WINDOWS\system32\msvcrt.dll 0x77f10000 0x49000 5.01.2600.5698 C:\WINDOWS\system32\GDI32.dll 0x7e410000 0x91000 5.01.2600.5512 C:\WINDOWS\system32\USER32.dll 0x77f60000 0x76000 6.00.2900.5912 C:\WINDOWS\system32\SHLWAPI.dl +l 0x71ab0000 0x17000 5.01.2600.5512 C:\WINDOWS\system32\WS2_32.DLL 0x71aa0000 0x8000 5.01.2600.5512 C:\WINDOWS\system32\WS2HELP.dl +l 0x6cec0000 0x10000 D:\strawberry\perl\bin\libgcc_ +s_sjlj-1.dll 0x21070000 0x10000 D:\strawberry\perl\lib\auto\Da +ta\Dumper\Dumper.dll 0x25230000 0xc000 D:\strawberry\perl\lib\auto\IO +\IO.dll 0x01250000 0x5e000 D:\strawberry\perl\vendor\lib\ +auto\XML\LibXML\LibXML.dll 0x70400000 0x114000 D:\strawberry\c\bin\libxml2-2_ +.dll 0x6a540000 0xe8000 1.13.0001.0000 D:\strawberry\c\bin\libiconv-2 +_.dll 0x692c0000 0x19000 1.02.0003.0000 D:\strawberry\c\bin\libz_.dll 0x1f250000 0x15000 D:\strawberry\perl\vendor\lib\ +auto\XML\LibXSLT\LibXSLT.xs.dll 0x660c0000 0x15000 D:\strawberry\c\bin\libexslt-0 +_.dll 0x6e980000 0x36000 D:\strawberry\c\bin\libxslt-1_ +.dll
        Thanks for your suggestion. I tried all that but still no use
        The XML::LibXSLT module is available with the installation. My perl script is working perfectly.
        C:\>pp --lib=c:\strawberry\perl\vendor\lib\XML -M XML::LibXML -M XML:: +LibXSLT -o test.exe test.pl
        I tried this but still the exe fails with the same error message.