New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
B::Deparse scoping problem with for loop #7390
Comments
From T.E.Hofmann@gmx.deCreated by T.E.Hofmann@gmx.de~ 111 > perl -le '$_="default" for my ($foo, $bar, $baz); print $foo' ~ 113 > perl -MO=Deparse -le '$_="default" for my ($foo, $bar, $baz); print $foo' so B::Deparse gets the scoping wrong. This is similar (the same?) to ticket #22073. Also see discussion at Perl Monks http://www.perlmonks.com/index.pl?node_id=369512 where this originally came up in a conversation between tilly and runrig. Perl Info
|
From smcc@mit.edu
TH> ~ 111 > perl -le '$_="default" for my ($foo, $bar, $baz); print $foo' TH> ~ 113 > perl -MO=Deparse -le '$_="default" for my ($foo, $bar, $baz); print $foo' TH> so B::Deparse gets the scoping wrong. This is similar (the same?) I don't think it's very closely related to #22037: "for (;;)" and TH> Also see discussion at Perl Monks TH> http://www.perlmonks.com/index.pl?node_id=369512 TH> where this originally came up in a conversation between tilly and Interesting. My first reaction was that this "for my" construction I think the right fix is to teach B::Deparse about the difference (The first hunk of the patch is totally unrelated, a note about -- Stephen Inline Patch
|
The RT System itself - Status changed from 'new' to 'open' |
From @demerphq
Just curious, but what about the case of: my $x=0 if 0; This is currently "optimized away" but the scoping effect on $x is not. And D:\Development>perl -MO=Deparse -e "use strict; my $x=1 if 0; $x||='boo'; Which is also wrong I should think.... Yves |
From @rgsOrton, Yves wrote:
Currently B::Deparse has no easy way to detect this situation. (maybe But "my $x if 0" is evil anyway :) |
From @demerphq
Agreed. :-) But the fact is that a lot of folks assume that the output from B::Deparse If the latter is too much effort for the payoff, such as for an evil Having said that I admit ive been too distracted with other things to review Yves |
From @rgsOrton, Yves wrote:
Yes, it is, now :) (change #23010 to bleadperl, thanks) |
@rspier - Status changed from 'open' to 'resolved' |
From @iabynOn Tue, Jun 29, 2004 at 01:17:57PM +0100, Orton, Yves wrote:
Note also that in bleed you now get a warning for this construct: $ perl591 -we 'my $x if 0' -- |
From @rgsStephen McCamant wrote:
Thanks, applied to bleadperl as #23046.
|
From at@altlinux.ruOn Mon, Jul 05, 2004 at 10:15:00AM -0700, Rafael Garcia-Suarez wrote:
Hello, While deparsing /home/at/tmp/perl-buildroot/usr/share/perl5/ExtUtils/MM_Unix.pm near line 1302,
|
From smcc@mit.edu
AT> On Mon, Jul 05, 2004 at 10:15:00AM -0700, Rafael Garcia-Suarez wrote: AT> Hello, AT> While deparsing /home/at/tmp/perl-buildroot/usr/share/perl5/ExtUtils/MM_Unix.pm near line 1302, Indeed. The confession is essentially an assertion failure, saying % ./perl -Ilib -MO=Deparse -e 'for $x (0) { $x } continue { $y }' The continue block gives the body of the loop a different shape, Two meta-level notes: * I'm ambivalent about this sort of half-baked change going into * B::Deparse really needs better regression tests: more extensive than -- Stephen |
From @nwc10On Tue, Jul 06, 2004 at 09:55:10PM -0700, Stephen McCamant wrote:
If experimental stuff isn't the point of blead, what is? Not enough people are using blead with real programs, which means that For example perl 5.8.5 contains bug fixes for 2 optimisations put into 5.8.4 Nicholas Clark |
Migrated from rt.perl.org#30504 (status was 'resolved')
Searchable as RT30504$
The text was updated successfully, but these errors were encountered: