summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/B/B/Deparse.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm
index fd8819167c..7bf95df56d 100644
--- a/ext/B/B/Deparse.pm
+++ b/ext/B/B/Deparse.pm
@@ -3158,10 +3158,11 @@ sub balanced_delim {
sub single_delim {
my($q, $default, $str) = @_;
return "$default$str$default" if $default and index($str, $default) == -1;
- my($succeed, $delim);
- ($succeed, $str) = balanced_delim($str);
- return "$q$str" if $succeed;
- for $delim ('/', '"', '#') {
+ if ($q ne 'qr') {
+ (my $succeed, $str) = balanced_delim($str);
+ return "$q$str" if $succeed;
+ }
+ for my $delim ('/', '"', '#') {
return "$q$delim" . $str . $delim if index($str, $delim) == -1;
}
if ($default) {