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


In reply to Re: Creating executables? by ELISHEVA
in thread Creating executables? by madhi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.