summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pod/perldiag.pod5
-rw-r--r--util.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
index 561d243d2b..3093e09afc 100644
--- a/pod/perldiag.pod
+++ b/pod/perldiag.pod
@@ -4711,6 +4711,11 @@ are automatically rebound to the current values of such variables.
its equivalent C<BEGIN> block found an internal inconsistency with
the version number.
+=item Version string '%s' contains invalid data; ignoring: '%s'
+
+(W misc) The version string contains invalid characters, so it is
+being ignored.
+
=item v-string in use/require is non-portable
(W portable) The use of v-strings is non-portable to older, pre-5.6, Perls.
diff --git a/util.c b/util.c
index 59c287f55e..2859a47413 100644
--- a/util.c
+++ b/util.c
@@ -4246,9 +4246,11 @@ Perl_upg_version(pTHX_ SV *ver)
version = savepv(SvPV_nolen(ver));
}
s = scan_version(version, ver, qv);
- if ( *s != '\0' )
- Perl_warn(aTHX_ "Version string '%s' contains invalid data; "
- "ignoring: '%s'", version, s);
+ if ( *s != '\0' )
+ if(ckWARN(WARN_MISC))
+ Perl_warner(aTHX_ packWARN(WARN_MISC),
+ "Version string '%s' contains invalid data; "
+ "ignoring: '%s'", version, s);
Safefree(version);
return ver;
}