From: Robin Houston Date: Mon, 14 May 2001 22:10:07 +0000 (+0100) Subject: "${foo}_bar" X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=44c6d2a19e4f4884d18ee1c0ea9d0d8e8eec68b5;p=p5sagit%2Fp5-mst-13.2.git "${foo}_bar" Message-ID: <20010514221007.A21118@penderel> p4raw-id: //depot/perl@10107 --- diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm index 19e9451..89b1002 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -3114,13 +3114,13 @@ sub dq { } elsif ($type eq "concat") { my $first = $self->dq($op->first); my $last = $self->dq($op->last); - # Disambiguate "${foo}bar", "${foo}{bar}", "${foo}[1]" - if ($last =~ /^[A-Z\\\^\[\]_?]/) { - $first =~ s/([\$@])\^$/${1}{^}/; # "${^}W" etc - } - elsif ($last =~ /^[{\[\w]/) { - $first =~ s/([\$@])([A-Za-z_]\w*)$/${1}{$2}/; - } + + # Disambiguate "${foo}bar", "${foo}{bar}", "${foo}[1]" + ($last =~ /^[A-Z\\\^\[\]_?]/ && + $first =~ s/([\$@])\^$/${1}{^}/) # "${^}W" etc + || ($last =~ /^[{\[\w_]/ && + $first =~ s/([\$@])([A-Za-z_]\w*)$/${1}{$2}/); + return $first . $last; } elsif ($type eq "uc") { return '\U' . $self->dq($op->first->sibling) . '\E';