http://www.perlmonks.org?node_id=5521

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question: (programs and processes)

How do I compile my script so that it becomes a standalone executable?

Originally posted as a Categorized Question.

  • Comment on How do I compile my script so that it becomes a standalone executable?

Replies are listed 'Best First'.
Re: How do I compile my script so that it becomes a standalone executable?
by Anonymous Monk on Dec 17, 2000 at 22:42 UTC
Re: How do I compile my script so that it becomes a standalone executable?
by Sniper (Scribe) on Jun 15, 2001 at 03:20 UTC

    ActiveState's Perl Dev Kit (PDK) includes a tool called PerlApp, which lets you:

    "Deploy Perl programs to any platform with its cross-platform wrapping. Deliver code as executables, Windows Services, ActiveX components, .NET assemblies.... Create MSI files..."
    It also supports remote debugging.

    Note that PerlApp does not "compile" your script. It encrypts it and wraps it in an .exe file, along with any modules used. When you run the .exe, it uncompresses the contained sources, and then runs the perl interpreter.

    Re: How do I compile my script so that it becomes a standalone executable?
    by Anonymous Monk on Mar 17, 2000 at 11:22 UTC
      Make sure you read all of this, to ensure that you're doing this for the "right" reasons--that is, it probably won't make your program run much faster, and it won't make your code more secure (ie., by "hiding" the source).
    Re: How do I compile my script so that it becomes a standalone executable?
    by Mr. Muskrat (Canon) on Mar 05, 2003 at 16:15 UTC

      Check out PAR, the Perl Archive Toolkit.

      It has been claimed that PAR handles security issues better than perl2exe or PerlApp.

      Re: How do I compile my script so that it becomes a standalone executable?
      by Anonymous Monk on Dec 09, 2003 at 15:47 UTC
        However, you must know that PerlApp does not "compile" your script.

        It encrypts it and places it in an exe file. The related libraries , used packages are also placed there.

        When you run the exe, the exe uncompressed the libraries and the source and the interpreter is started. It is almost the same as running "perl your own program".

        From my own experience,

        Equinox

        Originally posted as a Categorized Answer.

      Re: How do I compile my script so that it becomes a standalone executable?
      by Flame (Deacon) on Mar 06, 2003 at 14:41 UTC

        Check out PerlBin. It works on any platform, with any working build of perl; and you can package up your program as a zip file, tar ball, rpm, or whatever.

        Re: How do I compile my script so that it becomes a standalone executable?
        by rurban (Scribe) on Sep 21, 2016 at 14:22 UTC
          Additional information:

          perlcc will not work on windows due to missing symbols in the perl*.dll. For other platforms it is stable though.

          In cperl it works much better on windows, but is still not as stable as for the other platforms.

          Originally posted as a Categorized Answer.

        Re: How do I compile my script so that it becomes a standalone executable?
        by devslashneil (Friar) on Jun 19, 2003 at 03:37 UTC

          perlcc, which is now part of the B::C distro.

          It is alleged that perlcc does not work on Windows with standard perl builds (e.g. ActiveState, strawberry) due to missing symbols in the perl*.dll. Alternative builds of perl (such as cperl, which is by the author of perlcc itself) don't have this issue. Also, perlcc works fine on non-Windows platforms.