X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlop.pod;h=ba2ff9f73771a443e8b79e7bff59ceb543d355bd;hb=0d594e51e853b48a97327618a6e01007b612c5cd;hp=b86dda4fbaeae1d2277847271bb160bc0f883bef;hpb=3585017fa3325abea83bccc0b2f2e0fc4d3231f3;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlop.pod b/pod/perlop.pod index b86dda4..ba2ff9f 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -689,13 +689,30 @@ both its arguments into the list. The C<< => >> operator is a synonym for the comma, but forces any word (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. +as a string (as of 5.001). This includes words that might otherwise be +considered a constant or function call. + + use constant FOO => "something"; + + my %h = ( FOO => 23 ); + +is equivalent to: + + my %h = ("FOO", 23); + +It is I: + + my %h = ("something", 23); + +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. + %hash = ( $key => $value ); + login( $username => $password ); + =head2 List Operators (Rightward) On the right side of a list operator, it has very low precedence, @@ -1651,6 +1668,11 @@ Because the slash that terminated C was followed by a C, the example above is not C, but rather C with no C modifier. So the embedded C<#> is interpreted as a literal C<#>. +Also no attention is paid to C<\c\> during this search. +Thus the second C<\> in C is interpreted as a part of C<\/>, +and the following C is not recognized as a delimiter. +Instead, use C<\034> or C<\x1c> at the end of quoted constructs. + =item Removal of backslashes before delimiters During the second pass, text between the starting and ending @@ -1987,7 +2009,8 @@ depending on context. This distinction is determined on syntactic grounds alone. That means C<< <$x> >> is always a readline() from an indirect handle, but C<< <$hash{key}> >> is always a glob(). That's because $x is a simple scalar variable, but C<$hash{key}> is -not--it's a hash element. +not--it's a hash element. Even C<< <$x > >> (note the extra space) +is treated as C, not C. One level of double-quote interpretation is done first, but you can't say C<< <$foo> >> because that's an indirect filehandle as explained