summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Dubois <jand@activestate.com>2007-12-17 00:48:07 -0800
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-12-17 17:29:49 +0000
commita32521b767c799b2530a390662347774809e7a67 (patch)
tree904ecec5e6786e44e9c291bb3717d0a305609e2f
parent97dc7d3e75fba5b997341633941459733ca2a7a1 (diff)
downloadperl-a32521b767c799b2530a390662347774809e7a67.tar.gz
Document that $^V is no longer a v-string
From: "Jan Dubois" <jand@activestate.com> Message-ID: <007501c840cc$99b940e0$cd2bc2a0$@com> p4raw-id: //depot/perl@32631
-rw-r--r--pod/perl5100delta.pod8
-rw-r--r--pod/perldata.pod7
-rw-r--r--pod/perlvar.pod9
3 files changed, 14 insertions, 10 deletions
diff --git a/pod/perl5100delta.pod b/pod/perl5100delta.pod
index cf90dc939c..a1afa50f39 100644
--- a/pod/perl5100delta.pod
+++ b/pod/perl5100delta.pod
@@ -543,6 +543,14 @@ Previously, F<.pmc> files were loaded only if more recent than the
matching F<.pm> file. Starting with 5.9.4, they'll be always loaded if
they exist.
+=head2 $^V is now a C<version> object instead of a v-string
+
+$^V can still be used with the C<%vd> format in printf, but any
+character-level operations will now access the string representation
+of the C<version> object and not the ordinals of a v-string.
+Expressions like C<< substr($^V, 0, 2) >> or C<< split //, $^V >>
+no longer work and must be rewritten.
+
=head2 @- and @+ in patterns
The special arrays C<@-> and C<@+> are no longer interpolated in regular
diff --git a/pod/perldata.pod b/pod/perldata.pod
index 29004f04d0..7dcb5a98db 100644
--- a/pod/perldata.pod
+++ b/pod/perldata.pod
@@ -390,10 +390,9 @@ more dots in the literal, the leading C<v> may be omitted.
print 102.111.111; # same
Such literals are accepted by both C<require> and C<use> for
-doing a version check. The C<$^V> special variable also contains the
-running Perl interpreter's version in this form. See L<perlvar/$^V>.
-Note that using the v-strings for IPv4 addresses is not portable unless
-you also use the inet_aton()/inet_ntoa() routines of the Socket package.
+doing a version check. Note that using the v-strings for IPv4
+addresses is not portable unless you also use the
+inet_aton()/inet_ntoa() routines of the Socket package.
Note that since Perl 5.8.1 the single-number v-strings (like C<v65>)
are not v-strings before the C<< => >> operator (which is usually used
diff --git a/pod/perlvar.pod b/pod/perlvar.pod
index cf997fdf99..b2f14845b4 100644
--- a/pod/perlvar.pod
+++ b/pod/perlvar.pod
@@ -1314,15 +1314,12 @@ switch); see L<perlrun> for more info on this.
X<$^V> X<$PERL_VERSION>
The revision, version, and subversion of the Perl interpreter, represented
-as a string composed of characters with those ordinals. Thus in Perl v5.6.0
-it equals C<chr(5) . chr(6) . chr(0)> and will return true for
-C<$^V eq v5.6.0>. Note that the characters in this string value can
-potentially be greater than 255.
+as a C<version> object.
This variable first appeared in perl 5.6.0; earlier versions of perl will
-see an undefined value.
+see an undefined value. Before perl 5.10.0 $^V was represented as a v-string.
-This can be used to determine whether the Perl interpreter executing a
+$^V can be used to determine whether the Perl interpreter executing a
script is in the right range of versions. (Mnemonic: use ^V for Version
Control.) Example: