http://qs321.pair.com?node_id=869201

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

I am getting following error when trying to execute this exe

Can't locate utf8.pm in @INC (@INC contains: PERL2EXE_STORAGE/tmp  /xyz/lib/site_perl/5.8.0/sun4-solaris xyz/lib/site_perl/5.8.0 /usr/local/lib/perl5/site_perl .) at /test/sun.exe line 20

I am not using "utf8" inside the code and "utf8.pm" is present in the path in @INC.

Thanks for your help

Replies are listed 'Best First'.
Re: perl2exe error
by kcott (Archbishop) on Nov 03, 2010 at 11:20 UTC

    You have a relative path in @INC: xyz/lib/site_perl/5.8.0 should probably be /xyz/lib/site_perl/5.8.0 (i.e. add a leading slash). Is that where utf8.pm lives?

    If that doesn't solve your problem, please post the code so we can see what's happening at line 20.

    -- Ken

Re: perl2exe error
by sundialsvc4 (Abbot) on Nov 03, 2010 at 12:36 UTC

    I do not expect Perl to understand something like PERL2EXE_STORAGE/tmp.   Most likely this is intended to be a reference to a Shell environment-variable, but Perl will probably be looking for a directory, in the current-directory, that is named:   PERL2EXE_STORAGE.   (Undoubtedly, not what you want...)

    The path-names in @INC should be absolute path-names.   Something that you can guarantee will work anywhere, no matter where you are.

    A very handy command to remember is:   perl -V   (Note the capital “V”).   This will give you a complete dump of the search-path, among other things.

    You can also use a handy one-liner, like:   perl -e 'use utf8;'.

    “Wow!   I can do this in my sleep!”

      I think PERL2EXE_STORAGE is perfectly normal. It's what perl2exe uses to access its packaged libs.

Re: perl2exe error
by Anonymous Monk on Nov 03, 2010 at 13:25 UTC
    Have you tried what the manual suggests?

    3. Testing your executable

    Test the executable by running it from a command line prompt.

    If it dies with a "Can't locate somemodule.pm in @INC ... " error message, then add an explicit use statement for the missing module to your script.

    (...)