As others have correctly mentioned, there is no such thing as a platform-independent executable. What you're asking for is not unlike taking a generic roll of wallpaper but then trying to pre-cut one piece of it in advance to fit any wall.

How are you planning on distributing the executables? Download? CD/DVD/USB drive? Network install? Virus?

Your two best options, in my opinion, are:

  1. Package up the separate installers per the other suggestions in this thread
  2. If the functionality of your script lends itself to being run from a centralized location, consider making a browser web-app instead. That's the closest you'll come to a truly platform-independent solution that doesn't depend on an existing Perl installation.

If you go the download route, you can easily offer downloads for each platform, and in most cases, you can take a very good guess at the user's OS by inspecting the User-agent request header. (But use that as the default selection only; the header may be wrong, or users may have reason to download for a different OS.)

If you go with physical media, you can have an autorun.inf for Windows, and add some magic to the folder for OS X. See this Stackoverflow question on autoplay for OS X and Windows. There's no general autorun for Linux, which I consider a feature. :-)

For network deployments, it really depends on your deployment method, but generally you'd have parallel methods for each OS at some point in the process.

Hope this helps.


In reply to Re: Perl Executable by rjt
in thread Perl Executable by Anonymous Monk

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.