summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 7ecae350ba..673e324dc2 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3085,11 +3085,18 @@ PP(pp_require)
sv = POPs;
if ( (SvNIOKp(sv) || SvVOK(sv)) && PL_op->op_type != OP_DOFILE) {
- if ( SvVOK(sv) && ckWARN(WARN_PORTABLE) ) /* require v5.6.1 */
+ if (!PL_v_string_ok &&
+ SvVOK(sv) && ckWARN(WARN_PORTABLE) ) /* require v5.6.1 */
Perl_warner(aTHX_ packWARN(WARN_PORTABLE),
"v-string in use/require non-portable");
sv = new_version(sv);
+ if (PL_compcv &&
+ vcmp(sv, sv_2mortal(upg_version(newSVnv(5.006), FALSE))) >= 0)
+ /* version 5.006 recognises 5.x.y in C<use 5.x.y> so
+ can portably C<use 5.10.0> following C<use 5.006> */
+ PL_v_string_ok = TRUE;
+
if (!sv_derived_from(PL_patchlevel, "version"))
upg_version(PL_patchlevel, TRUE);
if (cUNOP->op_first->op_type == OP_CONST && cUNOP->op_first->op_private & OPpCONST_NOVER) {