From da8fb5d83273575a3f023278c420d4e97395a124 Mon Sep 17 00:00:00 2001 From: David Golden Date: Tue, 6 Jul 2010 00:33:31 -0400 Subject: [PATCH] Don't set strict for 'no 6;' Commit faee19b51573e81abe8811f1256a1d27777d6d04 was incomplete and only stopped features from being enabled under 'no'. This patch merges all 'use N.NN' type logic into a single if clause and then checks version numbers in separate if statements within it. --- pp_ctl.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/pp_ctl.c b/pp_ctl.c index 1525789..912e934 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -3365,21 +3365,20 @@ PP(pp_require) } /* We do this only with "use", not "require" or "no". */ - if (PL_compcv && - !(cUNOP->op_first->op_private & OPpCONST_NOVER) && - /* If we request a version >= 5.9.5, load feature.pm with the - * feature bundle that corresponds to the required version. */ - vcmp(sv, sv_2mortal(upg_version(newSVnv(5.009005), FALSE))) >= 0) { - SV *const importsv = vnormal(sv); - *SvPVX_mutable(importsv) = ':'; - ENTER_with_name("load_feature"); - Perl_load_module(aTHX_ 0, newSVpvs("feature"), NULL, importsv, NULL); - LEAVE_with_name("load_feature"); - } - /* If a version >= 5.11.0 is requested, strictures are on by default! */ - if (PL_compcv && - vcmp(sv, sv_2mortal(upg_version(newSVnv(5.011000), FALSE))) >= 0) { - PL_hints |= (HINT_STRICT_REFS | HINT_STRICT_SUBS | HINT_STRICT_VARS); + if (PL_compcv && !(cUNOP->op_first->op_private & OPpCONST_NOVER)) { + /* If we request a version >= 5.9.5, load feature.pm with the + * feature bundle that corresponds to the required version. */ + if (vcmp(sv, sv_2mortal(upg_version(newSVnv(5.009005), FALSE))) >= 0) { + SV *const importsv = vnormal(sv); + *SvPVX_mutable(importsv) = ':'; + ENTER_with_name("load_feature"); + Perl_load_module(aTHX_ 0, newSVpvs("feature"), NULL, importsv, NULL); + LEAVE_with_name("load_feature"); + } + /* If a version >= 5.11.0 is requested, strictures are on by default! */ + if (vcmp(sv, sv_2mortal(upg_version(newSVnv(5.011000), FALSE))) >= 0) { + PL_hints |= (HINT_STRICT_REFS | HINT_STRICT_SUBS | HINT_STRICT_VARS); + } } RETPUSHYES; -- 2.7.4