develooper Front page | perl.perl5.porters | Postings from December 2015

[perl #127026] B::Deparse fails to correctly deparse hash-derefswith conditional logic within

Thread Next
From:
yves orton
Date:
December 25, 2015 03:41
Subject:
[perl #127026] B::Deparse fails to correctly deparse hash-derefswith conditional logic within
Message ID:
rt-4.0.18-11099-1451014902-0.127026-75-0@perl.org
# New Ticket Created by  yves orton 
# Please include the string:  [perl #127026]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=127026 >


It seems that a construct like

%{ delete $_{x} || {} }

is deparsed horribly incorrectly:

$ perl -MO=Deparse -e'$x=sub{ scalar %{ delete $_{x} || {} } }; print $x->();'
$x = sub {
    scalar %{{} unless delete $_{'x'};};
}
;
print &$x();
-e syntax OK

This was originally a ticket against Data::Dump::Streamer which uses
B::Deparse internally for serializing code refs.

See:

https://rt.cpan.org/Ticket/Display.html?id=103543

Yves

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"


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