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

Hello: Recently I had to reinstall perl 5.6 and PerlDev Kit from ActiveState. It seems like it hosed up my registry. I compiled a perl application using Perlapp 3.0 with the -f (freestanding) option and I deployed it to another computer and I received the following error:
Can't locate File/Basename.pm in @INC (@INC contains: C:\DOCUME~1\tconti\LOCALS~ 1\Temp\2\XMLTest\{C1521678-58D3-4255-8522-22E56B852F4F}\ .) at XML/Simple.pm lin e 157.
When I run the same executable on my computer it works fine. I verified that the packages it is complaining aboout exist. Attached is a small test program that generated the above error. Any ideas? Thanks, Tom
use XML::Simple; use Data::Dumper; $parser = new XML::Simple; $configHash = $parser->XMLin('d:\test.xml', searchpath => '.', +forcearray => ['valueType']); print Dumper($configHash);

Replies are listed 'Best First'.
Re: PerlApp Question
by tachyon (Chancellor) on Apr 04, 2002 at 01:23 UTC

    When you make an exe with PerlApp it basically grabs your script, any modules the script uses and the perl.exe interpreter and wraps it in a PE (Portable Executable) file which is the native format of executable binaries (programs, dll's and drivers) for Microsoft Windows® 9x/ME/NT/2000 32-bit operating systems.

    For a PerlApp .exe @INC is essentially a reference to itself (actually there is some unwrapping done) but nonetheless the problem is that PerlApp has not included File::Basename (which is required by XML::Simple)

    Sensible advice is to get v4. You could fix the problem with a quick kludge by adding the line

    use File::Basename;

    to *your* script to make sure PerlApp knows it needs to grab this module.

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Re: PerlApp Question
by trs80 (Priest) on Apr 03, 2002 at 22:15 UTC
    Does the output from the PerlApp command show inclusion of the File::Basename module? Some dependencies are not found correctly by PerlApp, what commandline options are you using? Have you tried telling it explicitly to include File::Basename?

    side note: The PDK 4.0 version is much improved over 3.0. You have to uninstall 3.0 before you install 4.0 or it won't updgrade correctly.
Re: PerlApp Question
by Marza (Vicar) on Apr 03, 2002 at 23:34 UTC

    I will just move my post here since you did it twice

    I have perlapp version 4 and did not receive your errors

    I would get the new dev kit since perlapp seems to be cleanner

    If it really bugs you, notify ActiveState. But then again they will probably tell you to download 4.0 ;-)