Doc patches to clarify the stringification rules of {} and =>
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Sun, 13 Mar 2005 11:07:40 +0000 (11:07 +0000)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Sun, 13 Mar 2005 11:07:40 +0000 (11:07 +0000)
by Jarkko (bug #34419)

p4raw-id: //depot/perl@24033

pod/perldata.pod
pod/perlop.pod

index 254304c..1b02b1e 100644 (file)
@@ -336,8 +336,9 @@ In fact, an identifier within such curlies is forced to be a string,
 as is any simple identifier within a hash subscript.  Neither need
 quoting.  Our earlier example, C<$days{'Feb'}> can be written as
 C<$days{Feb}> and the quotes will be assumed automatically.  But
-anything more complicated in the subscript will be interpreted as
-an expression.
+anything more complicated in the subscript will be interpreted as an
+expression.  This means for example that C<$version{2.0}++> is
+equivalent to C<$version{2}++>, not to C<$version{'2.0'}++>.
 
 =head3 Version Strings
 
index aa0e339..7c96ee0 100644 (file)
@@ -688,9 +688,13 @@ In list context, it's just the list argument separator, and inserts
 both its arguments into the list.
 
 The C<< => >> operator is a synonym for the comma, but forces any word
-to its left to be interpreted as a string (as of 5.001). It is helpful
-in documenting the correspondence between keys and values in hashes,
-and other paired elements in lists.
+(consisting entirely of word characters) to its left to be interpreted
+as a string (as of 5.001).  If the argument on the left is not a word,
+it is first interpreted as an expression, and then the string value of
+that is used.
+
+The C<< => >> operator is helpful in documenting the correspondence
+between keys and values in hashes, and other paired elements in lists.
 
 =head2 List Operators (Rightward)