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

I have a script which uses Text::CSV cpan , I installed that cpan in my PC and its working fine . Now I wanted to make an exe file ,so I installed PAR::Packer and pp and created .exe successfully with this code pp -o packed.exe source.pl

so now when I run this executable on some other system which does not have this Text::CSV cpan it fails . I want that user without installing this cpan , and if possible even without installing perl be able to execute this exe file

Is it possible for me to be able to do it

FYI i also did pp -P -o packed.pl source.pl to make a packaged file , but when I execute it , an error saying "The application has failed to start because perl516.dll was not found " is shown

Replies are listed 'Best First'.
Re: making perl executable
by marto (Cardinal) on Jul 05, 2013 at 13:34 UTC

    You could make life a lot easier for yourself if you stop ignoring the advice you've been given. Your previous threads on this topic are all over the place. Had you actually read the documentation for pp you'd know that using the -P option isn't what you want to do:

    -P Create stand-alone perl script; do not package to a standalone binary.

    Please stop doing things at random in the hope they'll do what they want.

    Update: fixed typo.

      i know that , i made the exe file first , just to be safe i made the pl file . If you could please help with the problem of having cpan , in the exe that would be much more helpful than pointing my mistakes

        "i know that ,"

        Actually, you don't seem to know what you think you do.

        "just to be safe i made the pl file ."

        Since you want to use pp to create an executable, safety has nothing to do with the requirement to have some perl code. Where in any of the previous discussions we've had, or the documentation does it tell you to attempt what you're trying to do? You must provide perl code as an input to pp, otherwise what do you think you're going to package?

        Using pp you want to create a stand alone executable containing all the modules your code uses. At no point do you want to include cpan here. The second example in the documentation shows you how to create a standalone executable.

        pp -o hello hello.pl # Pack 'hello.pl' into executable 'hello' # (or 'hello.exe' on Win32)