This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [perl #21744] Deparse bug: "\::" deparsed as "::"
authorAdrian M. Enache <enache@rdslink.ro>
Sat, 29 Mar 2003 19:45:41 +0000 (21:45 +0200)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Tue, 1 Apr 2003 19:01:20 +0000 (19:01 +0000)
Message-ID: <20030329174541.GA8138@ratsnest.hole>

p4raw-id: //depot/perl@19127

ext/B/B/Deparse.pm

index 7b2358b..f2de6f7 100644 (file)
@@ -3246,10 +3246,10 @@ sub dq {
        my $first = $self->dq($op->first);
        my $last  = $self->dq($op->last);
 
-       # Disambiguate "${foo}bar", "${foo}{bar}", "${foo}[1]"
+       # Disambiguate "${foo}bar", "${foo}{bar}", "${foo}[1]", "$foo\::bar"
        ($last =~ /^[A-Z\\\^\[\]_?]/ &&
            $first =~ s/([\$@])\^$/${1}{^}/)  # "${^}W" etc
-           || ($last =~ /^[{\[\w_]/ &&
+           || ($last =~ /^[:'{\[\w_]/ &&
                $first =~ s/([\$@])([A-Za-z_]\w*)$/${1}{$2}/);
 
        return $first . $last;