X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperldata.pod;h=254304cad985fcdc52ac1bfe58eb4e968d1be700;hb=a537debe17982e491ffa12d12441cf74a452acb2;hp=f60d016fbff8646909886a0008134b9573f4f61b;hpb=692ef166768038d07562d41a21f34b424912aa08;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perldata.pod b/pod/perldata.pod index f60d016..254304c 100644 --- a/pod/perldata.pod +++ b/pod/perldata.pod @@ -341,6 +341,11 @@ an expression. =head3 Version Strings +B Version Strings (v-strings) have been deprecated. They will +be removed in some future release after Perl 5.8.1. The marginal +benefits of v-strings were greatly outweighed by the potential for +Surprise and Confusion. + A literal of the form C is parsed as a string composed of characters with the specified ordinals. This form, known as v-strings, provides an alternative, more readable way to construct @@ -360,6 +365,14 @@ 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. +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 +to separate a hash key from a hash value), instead they are interpreted +as literal strings ('v65'). They were v-strings from Perl 5.6.0 to +Perl 5.8.0, but that caused more confusion and breakage than good. +Multi-number v-strings like C and C<65.66.67> continue to +be v-strings always. + =head3 Special Literals The special literals __FILE__, __LINE__, and __PACKAGE__ @@ -587,8 +600,9 @@ key/value pairs. That's why it's good to use references sometimes. It is often more readable to use the C<< => >> operator between key/value pairs. The C<< => >> operator is mostly just a more visually distinctive synonym for a comma, but it also arranges for its left-hand operand to be -interpreted as a string--if it's a bareword that would be a legal identifier. -This makes it nice for initializing hashes: +interpreted as a string -- if it's a bareword that would be a legal simple +identifier (C<< => >> doesn't quote compound identifiers, that contain +double colons). This makes it nice for initializing hashes: %map = ( red => 0x00f, @@ -620,7 +634,7 @@ of how to arrange for an output ordering. =head2 Subscripts -An array is subscripted by specifying a dollary sign (C<$>), then the +An array is subscripted by specifying a dollar sign (C<$>), then the name of the array (without the leading C<@>), then the subscript inside square brackets. For example: