in reply to Creating executables?
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Creating executables?
by madhi (Initiate) on Jul 27, 2009 at 04:34 UTC |