develooper Front page | perl.perl5.changes | Postings from December 2017

[perl.git] branch blead updated. v5.27.6-133-g557714184d

From:
Zefram
Date:
December 5, 2017 20:56
Subject:
[perl.git] branch blead updated. v5.27.6-133-g557714184d
Message ID:
E1eMKGm-0008C8-5l@git.dc.perl.space
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/557714184de18964b954b2c00fa13127fd3f216a?hp=3c0dbbbaeb55e36a6beabd1cfc9f0432053bcaf0>

- Log -----------------------------------------------------------------
commit 557714184de18964b954b2c00fa13127fd3f216a
Author: Zefram <zefram@fysh.org>
Date:   Tue Dec 5 20:51:19 2017 +0000

    document hash/block disambig in perlsyn
    
    Fixes [perl #130958].

-----------------------------------------------------------------------

Summary of changes:
 pod/perlsyn.pod | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/pod/perlsyn.pod b/pod/perlsyn.pod
index efe4a26fc3..f5a2f2a92a 100644
--- a/pod/perlsyn.pod
+++ b/pod/perlsyn.pod
@@ -233,8 +233,16 @@ Sometimes a block is delimited by the file containing it (in the case
 of a required file, or the program as a whole), and sometimes a block
 is delimited by the extent of a string (in the case of an eval).
 
-But generally, a block is delimited by curly brackets, also known as braces.
-We will call this syntactic construct a BLOCK.
+But generally, a block is delimited by curly brackets, also known as
+braces.  We will call this syntactic construct a BLOCK.  Because enclosing
+braces are also the syntax for hash reference constructor expressions
+(see L<perlref>), you may occasionally need to disambiguate by placing a
+C<;> immediately after an opening brace so that Perl realises the brace
+is the start of a block.  You will more frequently need to disambiguate
+the other way, by placing a C<+> immediately before an opening brace to
+force it to be interpreted as a hash reference constructor expression.
+It is considered good style to use these disambiguating mechanisms
+liberally, not only when Perl would otherwise guess incorrectly.
 
 The following compound statements may be used to control flow:
 

-- 
Perl5 Master Repository



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About