A script I wrote for and tested with Apache on NT an Linux was recently moved to an MS IIS box. To my horror IIS would not run the script, claiming that -T was too late in the shebang line. To get the script to run, I was forced to remove the -T line.

It looks like IIS is simply running the script through Perl via the registry association: "perl.exe runs .pl files". Essentially it looks like the same error if you run the file from cmd.exe without specifying -T in the call.

Does this mean that most IIS boxes running Perl are always running with Taint off, or have their admins reconfigured NT so that Perl is always called with -T?

What is therefore the best way to write scripts so that they can be run as safely as possible and on as many platforms as possible, without having to rewrite them when they move box?

I assume that it's best to let Apache use a shebang rather than a registry association when running it on NT, see How does apache under NT find the perl interpreter?.

If I could we wouldn't be using MS IIS, but that's another story....


In reply to Taint with Perl on NT/IIS by ajt

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.