From: Michael G Schwern Date: Sun, 26 Apr 2009 02:16:12 +0000 (-0500) Subject: [PATCH] Allow PERL5OPT=-W X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2b622f1ab95eef319d54ddc6bec007dfd5f831a8;p=p5sagit%2Fp5-mst-13.2.git [PATCH] Allow PERL5OPT=-W --- diff --git a/perl.c b/perl.c index 701b010..130a83c 100644 --- a/perl.c +++ b/perl.c @@ -1923,7 +1923,7 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit) d = s; if (!*s) break; - if (!strchr("CDIMUdmtw", *s)) + if (!strchr("CDIMUdmtwW", *s)) Perl_croak(aTHX_ "Illegal switch in PERL5OPT: -%c", *s); while (++s && *s) { if (isSPACE(*s)) { diff --git a/pod/perlrun.pod b/pod/perlrun.pod index 308bea2..c3b30c8 100644 --- a/pod/perlrun.pod +++ b/pod/perlrun.pod @@ -974,7 +974,7 @@ is used. The program should instead say: X Command-line options (switches). Switches in this variable are taken -as if they were on every Perl command line. Only the B<-[CDIMUdmtw]> +as if they were on every Perl command line. Only the B<-[CDIMUdmtwW]> switches are allowed. When running taint checks (because the program was running setuid or setgid, or the B<-T> switch was used), this variable is ignored. If PERL5OPT begins with B<-T>, tainting will be diff --git a/t/run/runenv.t b/t/run/runenv.t index 1d2a6a7..03706ed 100644 --- a/t/run/runenv.t +++ b/t/run/runenv.t @@ -15,7 +15,7 @@ BEGIN { require './test.pl' } -plan tests => 75; +plan tests => 76; my $STDOUT = tempfile(); my $STDERR = tempfile(); @@ -157,6 +157,15 @@ try({PERL5OPT => '-t'}, '-1', ''); +try({PERL5OPT => '-W'}, + ['-e', 'local $^W = 0; no warnings; print $x'], + '', + < "foobar$Config{path_sep}42"}, ['-e', 'print grep { $_ eq "foobar" } @INC'], 'foobar',