summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/B/B/Deparse.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm
index a96e3c2b1f..7f6a321710 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;
}