From: Jan Dubois Date: Mon, 17 Dec 2007 08:48:07 +0000 (-0800) Subject: Document that $^V is no longer a v-string X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a32521b767c799b2530a390662347774809e7a67;p=p5sagit%2Fp5-mst-13.2.git Document that $^V is no longer a v-string From: "Jan Dubois" Message-ID: <007501c840cc$99b940e0$cd2bc2a0$@com> p4raw-id: //depot/perl@32631 --- diff --git a/pod/perl5100delta.pod b/pod/perl5100delta.pod index cf90dc9..a1afa50 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 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 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 29004f0..7dcb5a9 100644 --- a/pod/perldata.pod +++ b/pod/perldata.pod @@ -390,10 +390,9 @@ more dots in the literal, the leading C may be omitted. print 102.111.111; # same Such literals are accepted by both C and C for -doing a version check. The C<$^V> special variable also contains the -running Perl interpreter's version in this form. See L. -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) are not v-strings before the C<< => >> operator (which is usually used diff --git a/pod/perlvar.pod b/pod/perlvar.pod index cf997fd..b2f1484 100644 --- a/pod/perlvar.pod +++ b/pod/perlvar.pod @@ -1314,15 +1314,12 @@ switch); see L 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 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 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: