summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorTodd Rinaldo <toddr@cpan.org>2020-09-13 13:05:29 -0500
committerSawyer X <xsawyerx@cpan.org>2020-09-15 17:37:44 +0300
commitb1cc9c03acf2fd5c705634f9c3628c5721e80afa (patch)
tree0122b18c82c66e33546493f195928bfe26319aab /perl.c
parent19aaf9297b251db12d787e0eb31f06bfadc56856 (diff)
downloadperl-b1cc9c03acf2fd5c705634f9c3628c5721e80afa.tar.gz
Non-Configure code required to implement a strict by default option
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/perl.c b/perl.c
index f54dc6025f..992cbc30a4 100644
--- a/perl.c
+++ b/perl.c
@@ -2085,6 +2085,7 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
char c;
bool doextract = FALSE;
const char *cddir = NULL;
+ bool minus_e = FALSE; /* both -e and -E */
#ifdef USE_SITECUSTOMIZE
bool minus_f = FALSE;
#endif
@@ -2167,6 +2168,7 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
/* FALLTHROUGH */
case 'e':
forbid_setid('e', FALSE);
+ minus_e = TRUE;
if (!PL_e_script) {
PL_e_script = newSVpvs("");
add_read_e_script = TRUE;
@@ -2548,6 +2550,8 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
filter_add(read_e_script, NULL);
/* now parse the script */
+ if (minus_e == FALSE)
+ PL_hints |= HINTS_DEFAULT; /* after init_main_stash ; need to be after init_predump_symbols */
SETERRNO(0,SS_NORMAL);
if (yyparse(GRAMPROG) || PL_parser->error_count) {