In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/24fe90a14d91f512527a158a02ea19d502723856?hp=db69102781c2515ff4657c48b95696c5f5e3bb78>
- Log ----------------------------------------------------------------- commit 24fe90a14d91f512527a158a02ea19d502723856 Author: Father Chrysostomos <[email protected]> Date: Fri Oct 31 22:30:21 2014 -0700 perlfunc: Mention map {;...} convention since it is probably more common than { +... }. ----------------------------------------------------------------------- Summary of changes: pod/perlfunc.pod | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 8806486..d223158 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -3677,12 +3677,13 @@ C<{>. Usually it gets it right, but if it doesn't it won't realize something is wrong until it gets to the C<}> and encounters the missing (or unexpected) comma. The syntax error will be reported close to the C<}>, but you'll need to change something near the C<{> -such as using a unary C<+> to give Perl some help: +such as using a unary C<+> or semicolon to give Perl some help: %hash = map { "\L$_" => 1 } @array # perl guesses EXPR. wrong %hash = map { +"\L$_" => 1 } @array # perl guesses BLOCK. right - %hash = map { ("\L$_" => 1) } @array # this also works - %hash = map { lc($_) => 1 } @array # as does this. + %hash = map {; "\L$_" => 1 } @array # this also works + %hash = map { ("\L$_" => 1) } @array # as does this + %hash = map { lc($_) => 1 } @array # and this. %hash = map +( lc($_) => 1 ), @array # this is EXPR and works! %hash = map ( lc($_), 1 ), @array # evaluates to (1, @array) -- Perl5 Master Repository
