Change 20126 by [EMAIL PROTECTED] on 2003/07/10 22:20:02

        Add the deprecation warning for v-strings.
        
        (A Tale Of Caution: Originally I tried to use
         "no warnings 'deprecated'; in configpm, but that
         lead into whole lotta pain.  The warnings pragma
         pulls in Carp, and then Carp somehow messes up Exporter,
         and one ends up with several mysterious failures.
         Just don't go there.)

Affected files ...

... //depot/maint-5.8/perl/configpm#6 edit
... //depot/maint-5.8/perl/pod/perldelta.pod#35 edit
... //depot/maint-5.8/perl/pod/perldiag.pod#29 edit
... //depot/maint-5.8/perl/t/lib/warnings/toke#4 edit
... //depot/maint-5.8/perl/t/op/pack.t#10 edit
... //depot/maint-5.8/perl/toke.c#26 edit

Differences ...

==== //depot/maint-5.8/perl/configpm#6 (xtext) ====
Index: perl/configpm
--- perl/configpm#5~19919~      Tue Jul  1 14:28:15 2003
+++ perl/configpm       Thu Jul 10 15:20:02 2003
@@ -58,7 +58,11 @@
 
 open CONFIG, ">$Config_PM" or die "Can't open $Config_PM: $!\n";
 
-my $myver = sprintf "v%vd", $^V;
+my $myver;
+open(CONFIG_SH, 'config.sh') || die "Can't open config.sh: $!";
+while(<CONFIG_SH>) { if (/^version='(.+)'$/) { $myver = $1; last } }
+close(CONFIG_SH);
+die "Can't find version in config.sh\n" unless defined $myver;;
 
 printf CONFIG <<'ENDOFBEG', ($myver) x 3;
 # This file was created by configpm when Perl was built. Any changes
@@ -92,9 +96,9 @@
 die "Perl lib version (%s) doesn't match executable version ($])"
     unless $^V;
 
-$^V eq %s
-    or die "Perl lib version (%s) doesn't match executable version (" .
-       sprintf("v%%vd",$^V) . ")";
+my $exever = sprintf("%%vd",$^V);
+$exever eq "%s"
+    or die "Perl lib version (%s) doesn't match executable version ($exever)";
 
 ENDOFBEG
 

==== //depot/maint-5.8/perl/pod/perldelta.pod#35 (text) ====
Index: perl/pod/perldelta.pod
--- perl/pod/perldelta.pod#34~20121~    Thu Jul 10 11:01:21 2003
+++ perl/pod/perldelta.pod      Thu Jul 10 15:20:02 2003
@@ -190,44 +190,55 @@
 
 =head2 Deprecation Warnings
 
-Perl 5.8.0 forgot to add some deprecation warnings.  These warnings
-have now been added.
+There is one new feature deprecation.  Perl 5.8.0 forgot to add
+some deprecation warnings, these warnings have now been added.
+Finally, a reminder of an impending feature removal.
 
-=head3 Pseudo-hashes really are deprecated
+=head3 (New) Version Strings (v-strings) Are Deprecated
+
+Version Strings (v-strings) have been deprecated and they will be
+removed in some future release of Perl.  Each v-string will trigger
+the warning C<v-strings are deprecated>.   The marginal benefits of
+v-strings were greatly outweighed by the potential for Surprise and
+Confusion.  If you really want to continue using v-strings but not to
+see the deprecation warnings, use:
+
+    no warnings 'deprecated';
 
-Pseudo-hashes were deprecated in Perl 5.8.0 and will be removed in Perl
-5.10.0, see L<perl58delta> for details.  Each attempt to access pseudo-hashes
-will trigger the warning C<Pseudo-hashes are deprecated>.  If you really want
-to continue using pseudo-hashes but not to see the deprecation warnings, add:
+=head3 (Reminder) Pseudo-hashes really are deprecated
+
+Pseudo-hashes were deprecated in Perl 5.8.0 and will be removed in
+Perl 5.10.0, see L<perl58delta> for details.  Each attempt to access
+pseudo-hashes will trigger the warning C<Pseudo-hashes are deprecated>.
+If you really want to continue using pseudo-hashes but not to see the
+deprecation warnings, use:
 
     no warnings 'deprecated';
 
 Or you can continue to use the L<fields> pragma, but please don't
 expect the data structures to be pseudohashes any more.
 
-=head3 5.005-style threads really are deprecated
+=head3 (Reminder) 5.005-style threads really are deprecated
 
-5.005-style threads (activated by C<use Thread;>) were deprecated in Perl
-5.8.0 and will be removed in Perl 5.10.0, see L<perl58delta> for details.
-Each attempt to create a 5.005-style thread will trigger the warning
-C<5.005 threads are deprecated>.  If you really want to continue using
-5.005 threads but not to see the deprecation warnings, add:
+5.005-style threads (activated by C<use Thread;>) were deprecated in
+5.Perl 8.0 and will be removed after Perl 5.8, see L<perl58delta> for
+5.details.  Each 5.005-style thread creation will trigger the warning
+5.C<5.005 threads are deprecated>.  If you really want to continue
+5.using the 5.005 threads but not to see the deprecation warnings, use:
 
     no warnings 'deprecated';
 
-=head3 (New) Version Strings (v-strings) Are Deprecated
+=head3 (Reminder) The $* Variable Really Is Deprecated
 
-Version Strings (v-strings) have been deprecated.  They will not be
-available after Perl 5.8.  The marginal benefits of v-strings were
-greatly outweighed by the potential for Surprise and Confusion.
-
-=head3 The $* Variable Really Is Deprecated
-
-The C<$*> variable controlling multi-line matching has been
-deprecated.  It will not be available after Perl 5.8.  The variable
-has been deprecated for a long time, now it will just finally be
-removed.  The functionality has been supplanted by the C</s> and
-C</m> modifiers on pattern matching.
+The C<$*> variable controlling multi-line matching has been deprecated
+and will be removed after 5.8.  The variable has been deprecated for a
+long time, and a deprecation warning C<Use of $* is deprecated> is given,
+now the variable will just finally be removed.  The functionality has
+been supplanted by the C</s> and C</m> modifiers on pattern matching.
+If you really want to continue using the C<$*>-variable but not to see
+the deprecation warnings, use:
+
+    no warnings 'deprecated';
 
 =head2 Miscellaneous Enhancements
 

==== //depot/maint-5.8/perl/pod/perldiag.pod#29 (text) ====
Index: perl/pod/perldiag.pod
--- perl/pod/perldiag.pod#28~20045~     Sun Jul  6 22:00:40 2003
+++ perl/pod/perldiag.pod       Thu Jul 10 15:20:02 2003
@@ -4437,6 +4437,11 @@
 they will show a sensible error message indicating the required
 minimum version.
 
+=item v-strings are deprecated
+
+(D deprecated) v-strings are deprecated.  Their semantics and use were
+overly confusing.
+
 =item Warning: something's wrong
 
 (W) You passed warn() an empty string (the equivalent of C<warn "">) or

==== //depot/maint-5.8/perl/t/lib/warnings/toke#4 (text) ====
Index: perl/t/lib/warnings/toke
--- perl/t/lib/warnings/toke#3~19951~   Thu Jul  3 01:47:35 2003
+++ perl/t/lib/warnings/toke    Thu Jul 10 15:20:02 2003
@@ -799,4 +799,12 @@
 $s = "(@-)(@+)";
 EXPECT
 
+########
+# toke.c
+use warnings 'deprecated';
+$v = v65.66;
+no warnings 'deprecated';
+$v = v65.66;
+EXPECT
+v-strings are deprecated at - line 3.
 

==== //depot/maint-5.8/perl/t/op/pack.t#10 (xtext) ====
Index: perl/t/op/pack.t
--- perl/t/op/pack.t#9~19817~   Wed Jun 18 22:24:45 2003
+++ perl/t/op/pack.t    Thu Jul 10 15:20:02 2003
@@ -625,13 +625,16 @@
 }
 
 
-SKIP: {
-    skip("(EBCDIC and) version strings are bad idea", 2) if $Is_EBCDIC;
-
-    is("1.20.300.4000", sprintf "%vd", pack("U*",1,20,300,4000));
-    is("1.20.300.4000", sprintf "%vd", pack("  U*",1,20,300,4000));
+{
+    no warnings 'deprecated'; # v-strings
+  SKIP: {
+      skip("(EBCDIC and) version strings are bad idea", 2) if $Is_EBCDIC;
+
+      is("1.20.300.4000", sprintf "%vd", pack("U*",1,20,300,4000));
+      is("1.20.300.4000", sprintf "%vd", pack("  U*",1,20,300,4000));
+  }
+    isnt(v1.20.300.4000, sprintf "%vd", pack("C0U*",1,20,300,4000));
 }
-isnt(v1.20.300.4000, sprintf "%vd", pack("C0U*",1,20,300,4000));
 
 my $rslt = $Is_EBCDIC ? "156 67" : "199 162";
 is(join(" ", unpack("C*", chr(0x1e2))), $rslt);
@@ -656,7 +659,10 @@
     is("@{[unpack('C*', pack('U*', 100, 200))]}", "100 195 136");
 
     # does pack U0C create Unicode?
-    is("@{[pack('U0C*', 100, 195, 136)]}", v100.v200);
+    {
+       no warnings 'deprecated'; # v-strings
+       is("@{[pack('U0C*', 100, 195, 136)]}", v100.v200);
+    }
 
     # does pack C0U create characters?
     is("@{[pack('C0U*', 100, 200)]}", pack("C*", 100, 195, 136));

==== //depot/maint-5.8/perl/toke.c#26 (text) ====
Index: perl/toke.c
--- perl/toke.c#25~20122~       Thu Jul 10 11:06:05 2003
+++ perl/toke.c Thu Jul 10 15:20:02 2003
@@ -7980,6 +7980,9 @@
        }
     }
 
+    if (ckWARN(WARN_DEPRECATED))
+       Perl_warner(aTHX_ packWARN(WARN_DEPRECATED), "v-strings are deprecated", s);
+
     if (!isALPHA(*pos)) {
        UV rev;
        U8 tmpbuf[UTF8_MAXLEN+1];
End of Patch.

Reply via email to