Subject: | return { foo => 1 } should parse curlys as hash constructor, not block |
The perlref documentation says (under "3. A reference to an anonymous
hash can be created using curly brackets:" that placing a "return" in
front of the curly brackets tells Perl that the curly brackets do not
represent a block.
The subsequent examples seem to make it clear that this is a roundabout
way of saying that in "return { ... }" the curly brackets are
interpreted as a hash constructor. Pretty much the same verbiage is in
perlref in 5.6.2, 5.12.2, and 5.13.4.
But PPI interprets these as a block. A patch for this is in preparation,
basically repeating the logic that causes +{...} to be treated as a hash
constructor, SVN commit 8963. I will update this ticket when the patch
is committed.