Skip Menu |

This queue is for tickets about the Data-Dump-Streamer CPAN distribution.

Report information
The Basics
Id: 100509
Status: rejected
Priority: 0/
Queue: Data-Dump-Streamer

People
Owner: Nobody in particular
Requestors: 'spro^^*%*^6ut# [...] &$%*c
Cc:
AdminCc:

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



Subject: Lex vars in regexp code blocks can be eclipsed
$ perl5.12 -Mblib -MDDS -e '$sub1 = do { my $f; sub { $f } }; $sub2 = do { my $f; sub { $f } }; Dump [$sub1,$sub2]' my ($f,$f_eclipse_1); $f = undef; $f_eclipse_1 = undef; $ARRAY1 = [ sub { $f; }, sub { $f_eclipse_1; } ]; $ perl5.12 -Mblib -MDDS -e '$sub1 = do { my $f; sub { /(?{$f})/ } }; $sub2 = do { my $f; sub { /(?{$f})/ } }; Dump [$sub1,$sub2]' my ($f,$f_eclipse_1); $f = undef; $f_eclipse_1 = undef; $ARRAY1 = [ sub { /(?{$f})/; }, sub { /(?{$f})/; } ]; I see similar results with bleadperl, but without the $f_eclipse_1 definition. $ perl5.21.7 -Mblib -MDDS -e '$sub1 = do { my $f; sub { /(?{$f})/ } }; $sub2 = do { my $f; sub { /(?{$f})/ } }; Dump [$sub1,$sub2]' Subroutine B::OP::parent redefined at /Users/sprout/.cpan/build/B-Utils-0.25-K2jkIx/blib/lib/B/Utils.pm line 188. $ARRAY1 = [ sub { /(?{$f})/; }, sub { /(?{$f})/; } ]; Is this something you want to bother addressing? You would have to go rummaging through the ops inside regexp objects and feed them to the deparser, to get this to work properly. I plan to do something similar to B::Deparse (to fix not only this, but other issues), so this bug will be fixed ‘for you’ in bleadperl. I leave it to you whether older perls should be handled, or whether this ticket should just be rejected. This is not the result of real-world code, but just something I thought of when running perl’s tests through B::Deparse.
I am rejecting this ticket. DDS depends on B::Deparse to deal with these things correctly, and only does some modest effort to make sure eclipsing works properly. Since DDS does work fine in perl 5.22 (no doubt thanks to your good work) I am going to consider this a perl bug not a DDS bug. Thanks a lot for the report and core fixes! Sorry for the ridiculously long time fixing it.