++ 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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |