Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the PPI CPAN distribution.

Report information
The Basics
Id: 41733
Status: open
Priority: 0/
Queue: PPI

People
Owner: Nobody in particular
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: ${$hashref}{"KEY"} etc braced deref subscript
Date: Tue, 16 Dec 2008 10:30:26 +1100
To: bug-PPI [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
In PPI 1.204_01 and recent debian perl 5.10.0, a braced dereferencing from the "perlref" docs ${$hashref}{"KEY"} parses as PPI::Document PPI::Statement PPI::Token::Cast '$' PPI::Structure::Block { ... } PPI::Statement PPI::Token::Symbol '$hashref' PPI::Structure::Block { ... } PPI::Statement PPI::Token::Quote::Double '"KEY"' where I hoped the key part would be PPI::Structure::Subscript, the same as $foo{"KEY"} or $foo->{"KEY"} get. The array example ${$arrayref}[0] from perlref parses similarly with PPI::Structure::Constructor for the [] instead of Subscript. I struck this in some of my own code taking a hash slice from a hashref with @{$foo}{0,1,2,3}. Perlcritic complained I'd used a comma operator in the second part (where of course they're subscripts ...).
Confirming this bug exists in 1.215
{"KEY"} has been parsing as the hoped-for Subscript since at least PPI 1.215.