perlmodinstall 2.01 from Jon Orwant.
[p5sagit/p5-mst-13.2.git] / pod / perltrap.pod
index 753e721..831d2d5 100644 (file)
@@ -651,6 +651,16 @@ are to used around the name.
     # perl4 prints: {a}
     # perl5 prints: 2
 
+=item * Parsing
+
+When perl sees C<map {> (or C<grep {>), it has to guess whether the C<{>
+starts a BLOCK or a hash reference. If it guesses wrong, it will report
+a syntax error near the C<}> and the missing (or unexpected) comma.
+
+Use unary C<+> before C<{> on a hash reference, and unary C<+> applied
+to the first thing in a BLOCK (after C<{>), for perl to guess right all
+the time. (See L<perlfunc/map>.)
+
 =back
 
 =head2 Numerical Traps
@@ -688,7 +698,7 @@ If in doubt:
 
 Assignment of return values from numeric equality tests
 does not work in perl5 when the test evaluates to false (0).
-Logical tests now return an null, instead of 0
+Logical tests now return a null, instead of 0
 
     $p = ($test == 1);
     print $p,"\n";