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

[perl #107604] anonymous sub with attribute in void parse context isambiguous, should warn

Thread Next
From:
Father Chrysostomos via RT
Date:
June 30, 2016 22:30
Subject:
[perl #107604] anonymous sub with attribute in void parse context isambiguous, should warn
Message ID:
rt-4.0.18-3078-1467325800-1437.107604-15-0@perl.org
On Tue Jun 28 02:20:08 2016, dolmen wrote:
> Le Jeu 05 Jan 2012 06:12:10, zefram@fysh.org a écrit :
> > Olivier Mengu?? wrote:
> > >Workaround: force non-void parse context with '+':
> > >
> > >$ perl -MO=Deparse -e '+sub : lvalue { die; my $a }'
> > >BEGIN { $^W = 1; }
> > >sub : lvalue {
> > 
> > Here's an actual bug: B::Deparse's output suffers the unintended
> > interpretation.  B::Deparse needs to be taught the workaround.
> 
> I notice the B::Deparse bug is fixed in perl 5.24.0.
> 
>     $ perl -MO=Deparse -e '+sub :lvalue { die; my $a }'
>     +sub : lvalue {
>         die;
>         my $a;
>     }
>     ;
>     -e syntax OK
> 
> 
> I would be interested to see the commit that fixed that.

v5.21.5-218-g6b6b21d

-- 

Father Chrysostomos


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

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