diff options
author | Robin Houston <robin@cpan.org> | 2001-05-10 14:50:08 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-05-10 12:16:00 +0000 |
commit | b8e103fca6fa9c2611b91a6bfdd4418dd57da243 (patch) | |
tree | 1e502123d5451d376d348e0e8f83cbf78d398b9a /ext/B | |
parent | 9c0d12f1870cbb698224921504e0a8c942d1857c (diff) | |
download | perl-b8e103fca6fa9c2611b91a6bfdd4418dd57da243.tar.gz |
our() lists and foreach loops
Message-ID: <20010510135008.A2454@penderel>
p4raw-id: //depot/perl@10068
Diffstat (limited to 'ext/B')
-rw-r--r-- | ext/B/B/Deparse.pm | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm index 1aece28c49..d88c2c7dab 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -2208,8 +2208,15 @@ sub pp_list { # This assumes that no other private flags equal 128, and that # OPs that store things other than flags in their op_private, # like OP_AELEMFAST, won't be immediate children of a list. - unless ($lop->private & OPpLVAL_INTRO + # + # OP_ENTERSUB can break this logic, so check for it. + # I suspect that open and exit can too. + + if (!($lop->private & (OPpLVAL_INTRO|OPpOUR_INTRO) or $lop->name eq "undef") + or $lop->name eq "entersub" + or $lop->name eq "exit" + or $lop->name eq "open") { $local = ""; # or not last; @@ -2217,8 +2224,10 @@ sub pp_list { if ($lop->name =~ /^pad[ash]v$/) { # my() ($local = "", last) if $local eq "local" || $local eq "our"; $local = "my"; - } elsif ($op->name =~ /^(gv|rv2)[ash]v$/ - && $op->private & OPpOUR_INTRO) { # our() + } elsif ($lop->name =~ /^(gv|rv2)[ash]v$/ + && $lop->private & OPpOUR_INTRO + or $lop->name eq "null" && $lop->first->name eq "gvsv" + && $lop->first->private & OPpOUR_INTRO) { # our() ($local = "", last) if $local eq "my" || $local eq "local"; $local = "our"; } elsif ($lop->name ne "undef") { # local() |