From: Robin Houston Date: Fri, 20 Apr 2001 00:18:53 +0000 (+0100) Subject: Re: [abigail@foad.org: [ID 20000901.065] -MO=Deparse and $^W and $[ in same string.] X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7e40138b6937a53e2027c48d19bbbdf80c8a2f14;p=p5sagit%2Fp5-mst-13.2.git Re: [abigail@foad.org: [ID 20000901.065] -MO=Deparse and $^W and $[ in same string.] Message-ID: <20010420001853.A13350@puffinry.freeserve.co.uk> p4raw-id: //depot/perl@9759 --- diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm index 25db66a..47e8e99 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -2630,14 +2630,14 @@ sub const_sv { sub pp_const { my $self = shift; my($op, $cx) = @_; + if ($op->private & OPpCONST_ARYBASE) { + return '$['; + } # if ($op->private & OPpCONST_BARE) { # trouble with `=>' autoquoting # return $self->const_sv($op)->PV; # } my $sv = $self->const_sv($op); # return const($sv); - if ($op->private & OPpCONST_ARYBASE) { - return '$['; - } my $c = const $sv; return $c =~ /^-\d/ ? $self->maybe_parens($c, $cx, 21) : $c; } @@ -2647,7 +2647,10 @@ sub dq { my $op = shift; my $type = $op->name; if ($type eq "const") { - return uninterp(escape_str(unback($self->const_sv($op)->PV))); + if ($op->private & OPpCONST_ARYBASE) { + return '$['; + } + return uninterp(escape_str(unback(const($self->const_sv($op))))); } elsif ($type eq "concat") { my $first = $self->dq($op->first); my $last = $self->dq($op->last);