develooper Front page | perl.perl5.porters | Postings from June 2013

[perl #118451] Bareword hash key rejected when hash is a subroutine result and -> omitted

Thread Next
From:
Father Chrysostomos via RT
Date:
June 13, 2013 01:11
Subject:
[perl #118451] Bareword hash key rejected when hash is a subroutine result and -> omitted
Message ID:
rt-3.6.HEAD-9842-1371085875-1889.118451-15-0@perl.org
On Wed Jun 12 09:49:51 2013, rob.dixon@gmx.com wrote:
> 
> This is a bug report for perl from rob.dixon@gmx.com,
> generated with the help of perlbug 1.39 running under perl 5.16.2.
> 
> use strict;
> use warnings;
> use 5.016;
> 
> my $hashsub = sub {
>   { key => 'val' }
> };
> 
> # These work fine
> 
> print $hashsub->()->{key}, "\n";
> print $hashsub->(){'key'}, "\n";
> 
> # But this throws `Bareword "key" not allowed while "strict subs" in
>    use`
> 
> print $hashsub->(){key}, "\n";

Thank you for the report.  BTW, this is a duplicate of #8045.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=118451

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