From: John Peacock Date: Mon, 24 Sep 2001 17:29:03 +0000 (-0400) Subject: warning on v-string in use/require X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e3407aba2c52ce8e302b2dc706d0837bc82c537f;p=p5sagit%2Fp5-mst-13.2.git warning on v-string in use/require Message-ID: <3BAFA59F.9C0E0339@rowman.com> p4raw-id: //depot/perl@12205 --- diff --git a/ext/IO/lib/IO/Socket.pm b/ext/IO/lib/IO/Socket.pm index afe8b27..b62e7b3 100644 --- a/ext/IO/lib/IO/Socket.pm +++ b/ext/IO/lib/IO/Socket.pm @@ -6,7 +6,7 @@ package IO::Socket; -require v5.6; +require 5.006; use IO::Handle; use Socket 1.3; diff --git a/pp_ctl.c b/pp_ctl.c index d488b7c..2c7bde3 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -3061,6 +3061,9 @@ PP(pp_require) "v%d.%d.%d, stopped", rev, ver, sver, PERL_REVISION, PERL_VERSION, PERL_SUBVERSION); } + if (ckWARN(WARN_PORTABLE)) + Perl_warner(aTHX_ WARN_PORTABLE, + "v-string in use/require non-portable"); RETPUSHYES; } else if (!SvPOKp(sv)) { /* require 5.005_03 */ diff --git a/t/lib/warnings/pp_ctl b/t/lib/warnings/pp_ctl index ac01f27..59ced2b 100644 --- a/t/lib/warnings/pp_ctl +++ b/t/lib/warnings/pp_ctl @@ -222,6 +222,18 @@ EXPECT Use of uninitialized value in print at (eval 1) line 1. ######## # pp_ctl.c +use warnings 'portable'; +eval 'use 5.6.1'; +EXPECT +v-string in use/require non-portable at (eval 1) line 2. +######## +# pp_ctl.c +use warnings 'portable'; +eval 'use v5.6.1'; +EXPECT +v-string in use/require non-portable at (eval 1) line 2. +######## +# pp_ctl.c use warnings; { no warnings;