develooper Front page | perl.perl5.porters | Postings from March 2003

Re: [perl #21744] Deparse bug: "\::" deparsed as "::"

Thread Previous | Thread Next
From:
Enache Adrian
Date:
March 29, 2003 08:51
Subject:
Re: [perl #21744] Deparse bug: "\::" deparsed as "::"
Message ID:
20030329165055.GA7890@ratsnest.hole
On Sat, Mar 29, 2003 at 03:53:18PM -0000, Juerd wrote:
> 2;0 juerd@ouranos:~$ perl -MO=Deparse -e'print "$foo\::bar"'
> print "$foo::bar";
> -e syntax OK
> 2;0 juerd@ouranos:~$ perl -MO=Deparse -e'print "${foo}::bar"'
> print "$foo::bar";
> -e syntax OK

Should this be a solution ?

Regards
Adi

-----------------------------------------------------------------
--- /arc/bleadperl/ext/B/B/Deparse.pm	2003-03-25 04:00:20.000000000 +0200
+++ ./ext/B/B/Deparse.pm	2003-03-29 18:49:18.000000000 +0200
@@ -3246,10 +3246,10 @@
 	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;

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About