From: Robin Houston Date: Thu, 26 Apr 2001 17:13:41 +0000 (+0100) Subject: [PATCH B::Deparse] fix string uninterpretation X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4682a7acab84a46ed9d265e274b72494a4818695;p=p5sagit%2Fp5-mst-13.2.git [PATCH B::Deparse] fix string uninterpretation Date: Thu, 26 Apr 2001 17:13:41 +0100 Message-ID: <20010426171341.A27299@puffinry.freeserve.co.uk> Subject: Re: [PATCH B::Deparse] fix string uninterpretation From: Robin Houston Date: Thu, 26 Apr 2001 18:44:29 +0100 Message-ID: <20010426184429.A27734@puffinry.freeserve.co.uk> p4raw-id: //depot/perl@9856 --- diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm index a96e3c2..7f6a321 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -2754,15 +2754,15 @@ sub pp_enterwrite { unop(@_, "write") } # but not character escapes sub uninterp { my($str) = @_; - $str =~ s/(^|[^\\])([\$\@]|\\[uUlLQE])/$1\\$2/g; + $str =~ s/(^|\G|[^\\])((?:\\\\)*)([\$\%\@]|\\[uUlLQE])/$1$2\\$3/g; return $str; } -# the same, but treat $|, $), and $ at the end of the string differently +# the same, but treat $|, $), $( and $ at the end of the string differently sub re_uninterp { my($str) = @_; - $str =~ s/(^|[^\\])(\@|\\[uUlLQE])/$1\\$2/g; - $str =~ s/(^|[^\\])(\$[^)|])/$1\\$2/g; + $str =~ s/(^|\G|[^\\])((?:\\\\)*)([\$\%\@](?!\||\)|\$\(|$)|\\[uUlLQE])/$1$2\\$3/g +; return $str; }