warning on v-string in use/require
authorJohn Peacock <jpeacock@rowman.com>
Mon, 24 Sep 2001 17:29:03 +0000 (13:29 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Tue, 25 Sep 2001 17:20:38 +0000 (17:20 +0000)
Message-ID: <3BAFA59F.9C0E0339@rowman.com>

p4raw-id: //depot/perl@12205

ext/IO/lib/IO/Socket.pm
pp_ctl.c
t/lib/warnings/pp_ctl

index afe8b275962f340698e9bb89d738eeceacc5cdf0..b62e7b39dd7dbbc3ea8d0b094e2ba48e92111f27 100644 (file)
@@ -6,7 +6,7 @@
 
 package IO::Socket;
 
-require v5.6;
+require 5.006;
 
 use IO::Handle;
 use Socket 1.3;
index d488b7ce37ee920b793d3a5f5ec3ee224f24dce2..2c7bde33c769d98a424e3a67aee6c80f3d55a50d 100644 (file)
--- 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 */
index ac01f277b1fa6940d238c29bd24be1ded142d086..59ced2b4460c20c58ad6b399c3abc2daf0e07e49 100644 (file)
@@ -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;