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

Dear Monks,

is there any utility to create executables other than 'pp' and ‘perlcc’.

Regards Madhi

Replies are listed 'Best First'.
Re: Creating executables?
by moritz (Cardinal) on Jul 26, 2009 at 13:20 UTC
    Yes, there's PAR for example
Re: Creating executables?
by ELISHEVA (Prior) on Jul 27, 2009 at 03:44 UTC

    Madhi - the only way any software runs on "all" platforms is if it is running in a virtual machine or interpreter installed on that platform.

    For example, when we say Javascript runs on all platforms, we really mean that Javascript runs on all platforms where there is a Javascript enabled browser. When we say Java applications run on all platforms we mean that Java applications run on all platforms where a JVM (Java virtual machine) is installed. The same is true for Perl. Perl runs on all platforms where there is a Perl interpreter installed.

    Most Linux machines already have a Perl interpreter. In some cases (e.g. Debian) the Perl interpreter is even used by the operating system itself. For other OS's, such as Windows, you will need to install a Perl interpreter if there isn't one there already.

    There are many ways to check to see if Perl is already installed and even to automatically download it. However, the automatic installation program will always be platform specific. Each operating system has its own package management logic. For example, if you are installing to Windows Vista, you will need to generate an MSI file that does that. (You can use either NSIS or WIX to generate MSI packages if you are interested).

    If you don't want to use a virtual machine or interpreter, then your only other option is to generate an executable. However, this doesn't create software that runs on all platforms. It creates software that runs on one platform. If you go the route of creating executables (rather than scripts or byte code that run on an interpreter or JVM), you will need to generate a different executable for each operating system to which you want to distribute your application. This isn't a Perl specific issue. It is true for anything that you want to distribute as a binary executable, regardless of the language that the software was written in.

    Your advantage with Perl is that you have an option: (a) generate executables for each individual platform or (b) write once for all platforms and only worry about whether or not the interpreter has already been installed. Many companies find writing once and using an interpreter more cost effective, but your mileage may vary.

    Best, beth

      Thanks beth for throwing light to clarify my doubt

Re: Creating executables?
by tokpela (Chaplain) on Jul 26, 2009 at 20:51 UTC

    There is PerlApp which is part of the Perl Development Kit by Activestate.

    Version 8 is cross-platform and allows you to deploy to any platform (though I have not done this myself).

      PerlApp is nice for distributing perl scripts to Windows users who don't have perl. It's simple to use and works surprisingly well IMHO.

      However, the "any platform" bit was probably written by someone at ActiveState who knows more about marketing than about computers.

      -- Time flies when you don't know what you're doing

      I don't think PerlApp can deploy Perl scripts to any platform. It may be able to deploy them to a few platforms, to those for which an ActivePerl distribution has been compiled. I have doubts that it can deploy to embedded Linux systems, like a WRT54G or even smaller systems. I don't think that it can deploy to the classic MacOS System 7, 8 or 9. I doubt it can deploy to OS/2, HP-UX or to a VAX. And I'm 100% sure that it can't deploy to the C64 or the ZX81. ;-)

      PerlApp costs money, and not just five bucks. I don't have a big problem with that, but even if you spend the money, it won't solve the problem.

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

        I don't see why you think the OP wants to deploy to every platform.

        madhi, could you explain what your goal is?

Re: Creating executables?
by afoken (Chancellor) on Jul 26, 2009 at 17:53 UTC

    Is this question related to perl pp packging problem?

    I think it is, so why do you open a new thread? I explained you in Re^3: perl pp packging problem that you can't generate a single executable for "any Linux machine which doesn’t have any Perl module installed". And because it is impossible, there can't be any tool to generate such an executable. I also showed you a different way to solve your problem in that node, borrowed from bugzilla, that would solve your problem.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
Re: Creating executables?
by JavaFan (Canon) on Jul 26, 2009 at 20:40 UTC
    I've no idea what your real question is, but under Unix, chmod can be used to make executables.