On Windows, it will look for the contents of $ENV{PERL5SHELL} for a complete string (command name and switches) that it prepends to the string you are running.

If that environment variable does not exist, it uses either "CMD.EXE /X/C" or "COMMAND.COM /C" depending one whether it's running NT or Win9x.

Having different shells on Win9x vs NT can expose differences, since CMD with the /X switch does more than COMMAND.COM.

I know Perl used to use $ENV{COMSPEC} because I relied on the capabilites of my shell (the one that invoked the perl script in the first place) and found it broke at some point. That's when I learned about PERL5SHELL. I seem to recall that there was also some "common" min-shell shipped with activestate Perl at some point, to prevent differences between 9x and NT.

—John


In reply to $ENV{PERL5SHELL} by John M. Dlugosz
in thread Security concern with sudo and system() by evlg

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.