| 1 |
Disable the "v-string in use/require is non-portable" warning (again).
|
| 2 |
|
| 3 |
Upstream change 32910, Debian bug #479863
|
| 4 |
|
| 5 |
diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm
|
| 6 |
index 77ae15f..7092830 100644
|
| 7 |
--- a/ext/B/B/Deparse.pm
|
| 8 |
+++ b/ext/B/B/Deparse.pm
|
| 9 |
@@ -1456,7 +1456,6 @@ sub declare_hints {
|
| 10 |
my %ignored_hints = (
|
| 11 |
'open<' => 1,
|
| 12 |
'open>' => 1,
|
| 13 |
- 'v_string' => 1,
|
| 14 |
);
|
| 15 |
|
| 16 |
sub declare_hinthash {
|
| 17 |
diff --git a/pod/perldiag.pod b/pod/perldiag.pod
|
| 18 |
index 1dd79a3..29d3cd6 100644
|
| 19 |
--- a/pod/perldiag.pod
|
| 20 |
+++ b/pod/perldiag.pod
|
| 21 |
@@ -4935,18 +4935,6 @@ the version number.
|
| 22 |
(W misc) The version string contains invalid characters at the end, which
|
| 23 |
are being ignored.
|
| 24 |
|
| 25 |
-=item v-string in use/require is non-portable
|
| 26 |
-
|
| 27 |
-(W portable) The use of v-strings is non-portable to older, pre-5.6, Perls.
|
| 28 |
-If you want your scripts to be backward portable, use the floating
|
| 29 |
-point version number: for example, instead of C<use 5.6.1> say
|
| 30 |
-C<use 5.006_001>. This of course won't make older Perls suddenly start
|
| 31 |
-understanding newer features, but at least they will show a sensible
|
| 32 |
-error message indicating the required minimum version.
|
| 33 |
-
|
| 34 |
-This warning is suppressed if the C<use 5.x.y> is preceded by a
|
| 35 |
-C<use 5.006> (see C<use VERSION> in L<perlfunc/use>).
|
| 36 |
-
|
| 37 |
=item Warning: something's wrong
|
| 38 |
|
| 39 |
(W) You passed warn() an empty string (the equivalent of C<warn "">) or
|
| 40 |
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
|
| 41 |
index a779b3b..d64e7a1 100644
|
| 42 |
--- a/pod/perlfunc.pod
|
| 43 |
+++ b/pod/perlfunc.pod
|
| 44 |
@@ -6855,22 +6855,16 @@ of perl older than the specified one.
|
| 45 |
|
| 46 |
Specifying VERSION as a literal of the form v5.6.1 should generally be
|
| 47 |
avoided, because it leads to misleading error messages under earlier
|
| 48 |
-versions of Perl that do not support this syntax. The equivalent numeric
|
| 49 |
-version should be used instead.
|
| 50 |
-
|
| 51 |
-Alternatively, you can use a numeric version C<use 5.006> followed by a
|
| 52 |
-v-string version like C<use v5.10.1>, to avoid the unintuitive C<use
|
| 53 |
-5.010_001>. (older perl versions fail gracefully at the first C<use>,
|
| 54 |
-later perl versions understand the v-string syntax in the second).
|
| 55 |
+versions of Perl (that is, prior to 5.6.0) that do not support this
|
| 56 |
+syntax. The equivalent numeric version should be used instead.
|
| 57 |
|
| 58 |
use v5.6.1; # compile time version check
|
| 59 |
use 5.6.1; # ditto
|
| 60 |
use 5.006_001; # ditto; preferred for backwards compatibility
|
| 61 |
- use 5.006; use 5.6.1; # ditto, for compatibility and readability
|
| 62 |
|
| 63 |
This is often useful if you need to check the current Perl version before
|
| 64 |
-C<use>ing library modules that have changed in incompatible ways from
|
| 65 |
-older versions of Perl. (We try not to do this more than we have to.)
|
| 66 |
+C<use>ing library modules that won't work with older versions of Perl.
|
| 67 |
+(We try not to do this more than we have to.)
|
| 68 |
|
| 69 |
Also, if the specified perl version is greater than or equal to 5.9.5,
|
| 70 |
C<use VERSION> will also load the C<feature> pragma and enable all
|
| 71 |
diff --git a/pp_ctl.c b/pp_ctl.c
|
| 72 |
index 64157f3..7a377f0 100644
|
| 73 |
--- a/pp_ctl.c
|
| 74 |
+++ b/pp_ctl.c
|
| 75 |
@@ -3076,14 +3076,6 @@ PP(pp_require)
|
| 76 |
|
| 77 |
sv = POPs;
|
| 78 |
if ( (SvNIOKp(sv) || SvVOK(sv)) && PL_op->op_type != OP_DOFILE) {
|
| 79 |
- if ( SvVOK(sv) && ckWARN(WARN_PORTABLE) ) { /* require v5.6.1 */
|
| 80 |
- HV * hinthv = GvHV(PL_hintgv);
|
| 81 |
- SV ** ptr = NULL;
|
| 82 |
- if (hinthv) ptr = hv_fetchs(hinthv, "v_string", FALSE);
|
| 83 |
- if ( !(ptr && *ptr && SvIOK(*ptr) && SvIV(*ptr)) )
|
| 84 |
- Perl_warner(aTHX_ packWARN(WARN_PORTABLE),
|
| 85 |
- "v-string in use/require non-portable");
|
| 86 |
- }
|
| 87 |
sv = new_version(sv);
|
| 88 |
if (!sv_derived_from(PL_patchlevel, "version"))
|
| 89 |
upg_version(PL_patchlevel, TRUE);
|
| 90 |
@@ -3135,26 +3127,14 @@ PP(pp_require)
|
| 91 |
|
| 92 |
/* We do this only with use, not require. */
|
| 93 |
if (PL_compcv &&
|
| 94 |
- /* If we request a version >= 5.6.0, then v-string are OK
|
| 95 |
- so set $^H{v_string} to suppress the v-string warning */
|
| 96 |
- vcmp(sv, sv_2mortal(upg_version(newSVnv(5.006), FALSE))) >= 0) {
|
| 97 |
- HV * hinthv = GvHV(PL_hintgv);
|
| 98 |
- if( hinthv ) {
|
| 99 |
- SV *hint = newSViv(1);
|
| 100 |
- (void)hv_stores(hinthv, "v_string", hint);
|
| 101 |
- /* This will call through to Perl_magic_sethint() which in turn
|
| 102 |
- sets PL_hints correctly. */
|
| 103 |
- SvSETMAGIC(hint);
|
| 104 |
- }
|
| 105 |
/* If we request a version >= 5.9.5, load feature.pm with the
|
| 106 |
* feature bundle that corresponds to the required version. */
|
| 107 |
- if (vcmp(sv, sv_2mortal(upg_version(newSVnv(5.009005), FALSE))) >= 0) {
|
| 108 |
+ vcmp(sv, sv_2mortal(upg_version(newSVnv(5.009005), FALSE))) >= 0) {
|
| 109 |
SV *const importsv = vnormal(sv);
|
| 110 |
*SvPVX_mutable(importsv) = ':';
|
| 111 |
ENTER;
|
| 112 |
Perl_load_module(aTHX_ 0, newSVpvs("feature"), NULL, importsv, NULL);
|
| 113 |
LEAVE;
|
| 114 |
- }
|
| 115 |
}
|
| 116 |
|
| 117 |
RETPUSHYES;
|
| 118 |
diff --git a/t/lib/warnings/pp_ctl b/t/lib/warnings/pp_ctl
|
| 119 |
index 923d54c..afaf0a7 100644
|
| 120 |
--- a/t/lib/warnings/pp_ctl
|
| 121 |
+++ b/t/lib/warnings/pp_ctl
|
| 122 |
@@ -222,18 +222,6 @@ EXPECT
|
| 123 |
Use of uninitialized value $foo in print at (eval 1) line 1.
|
| 124 |
########
|
| 125 |
# pp_ctl.c
|
| 126 |
-use warnings 'portable';
|
| 127 |
-eval 'use 5.6.1';
|
| 128 |
-EXPECT
|
| 129 |
-v-string in use/require non-portable at (eval 1) line 2.
|
| 130 |
-########
|
| 131 |
-# pp_ctl.c
|
| 132 |
-use warnings 'portable';
|
| 133 |
-eval 'use v5.6.1';
|
| 134 |
-EXPECT
|
| 135 |
-v-string in use/require non-portable at (eval 1) line 2.
|
| 136 |
-########
|
| 137 |
-# pp_ctl.c
|
| 138 |
use warnings;
|
| 139 |
{
|
| 140 |
no warnings;
|
| 141 |
@@ -245,15 +233,3 @@ EXPECT
|
| 142 |
use warnings;
|
| 143 |
eval 'use 5.006; use 5.10.0';
|
| 144 |
EXPECT
|
| 145 |
-########
|
| 146 |
-# pp_ctl.c
|
| 147 |
-use warnings;
|
| 148 |
-eval '{use 5.006;} use 5.10.0';
|
| 149 |
-EXPECT
|
| 150 |
-v-string in use/require non-portable at (eval 1) line 2.
|
| 151 |
-########
|
| 152 |
-# pp_ctl.c
|
| 153 |
-use warnings;
|
| 154 |
-eval 'use vars; use 5.10.0';
|
| 155 |
-EXPECT
|
| 156 |
-v-string in use/require non-portable at (eval 1) line 2.
|