Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

The hardest bit IMO isn't writing the perl code, it's making it executable on all the bizarro platforms that perl runs on. That is, to get the #! line right on Unix-a-likes, but make it a valid .BAT file on Windows, and whatever is needed on VMS.

Thankfully, there's a tool to do that.

ExtUtils::MakeMaker and, presumably, Module::Build, have the smarts to edit your scripts appropriately at install time so you don't have to worry about it. If for some reason you can't use either of those tools, then the maximally portable preamble for Unix-a-likes is:

#!/bin/sh exec perl -x $0 "$@" #!perl # your perl code goes here

but I have no idea what to do, or even if you can, make that also portable to other platforms.


In reply to Re: OS independent perl script by DrHyde
in thread OS independent perl script by vinoth.ree

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-19 18:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found