develooper Front page | perl.perl5.porters | Postings from March 2014

RE: [perl #121501] Empty code block {} causes syntax error(misparsed as anonymous hash constructor?) before 'sub'

Thread Previous | Thread Next
From:
Ed Avis
Date:
March 25, 2014 15:35
Subject:
RE: [perl #121501] Empty code block {} causes syntax error(misparsed as anonymous hash constructor?) before 'sub'
Message ID:
7E039918541B4C4183BFDB8F015C743069781E@WCL-EXCH02.wcl.local
I did not forget that {} is also the anonymous hash constructor - see the subject of this bug report.

What I suggest, if it is possible, is that where {} is currently parsed as a hash constructor but that
gives a syntax error, perl should try instead to parse it as a block.  This would not change the semantics
of any existing valid program but it would remove the syntactic wart that an empty block cannot
always appear where a nonempty one can.

-- 
Ed Avis <eda@waniasset.com>

______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

Thread Previous | Thread Next


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