summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-03-13 11:07:40 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-03-13 11:07:40 +0000
commit719b43e8a7892cfc854b9123fcad88c53828b0b9 (patch)
tree546e74c292fae1ff25581a9e37830e42276b01e8 /pod
parent22469a62e89c5b688296aee74b9b68348ff12194 (diff)
downloadperl-719b43e8a7892cfc854b9123fcad88c53828b0b9.tar.gz
Doc patches to clarify the stringification rules of {} and =>
by Jarkko (bug #34419) p4raw-id: //depot/perl@24033
Diffstat (limited to 'pod')
-rw-r--r--pod/perldata.pod5
-rw-r--r--pod/perlop.pod10
2 files changed, 10 insertions, 5 deletions
diff --git a/pod/perldata.pod b/pod/perldata.pod
index 254304cad9..1b02b1e192 100644
--- a/pod/perldata.pod
+++ b/pod/perldata.pod
@@ -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
diff --git a/pod/perlop.pod b/pod/perlop.pod
index aa0e33905e..7c96ee05ac 100644
--- a/pod/perlop.pod
+++ b/pod/perlop.pod
@@ -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)