++ Thanks for your response.

I only started using PERL5OPT a few weeks ago because I was sick of having to add those pragmata whenever I wanted a quick one-liner.

The "perlrun: PERL5OPT" documentation starts:

"Command-line options (switches). Switches in this variable are treated as if they were on every Perl command line."

I took this to mean that (with my current PERL5OPT settings)

perl -E '...'

would be expanded to

perl -Mstrict -Mwarnings -Mautodie -E '...'

I ran quite a few tests and, when satisfied everything worked OK, modified my .bash_profile so that it would always be available.

It never occurred to me that this would affect scripts; however, following your comments, I've run additional script tests and it does appear that my shebang line

#!/usr/bin/env perl

is being altered to

#!/usr/bin/env perl -Mstrict -Mwarnings -Mautodie

As I always add strict and warnings to every script, and often add autodie, this is not a problem for me. So, while I thank you for alerting me to this, I will continue to use PERL5OPT as I'm currently doing unless I come across a good reason for not doing so.

"It makes your scripts non-portable."

Perhaps you could expand on this. I'm failing to see any portability issues.

— Ken


In reply to Re^3: Need script help by kcott
in thread Need script help by jmckinzie

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.