summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dist/B-Deparse/Deparse.pm5
-rw-r--r--dist/B-Deparse/t/deparse.t5
2 files changed, 7 insertions, 3 deletions
diff --git a/dist/B-Deparse/Deparse.pm b/dist/B-Deparse/Deparse.pm
index ccc8bc084c..648a17c14a 100644
--- a/dist/B-Deparse/Deparse.pm
+++ b/dist/B-Deparse/Deparse.pm
@@ -1335,7 +1335,8 @@ sub maybe_qualify {
return $name if !$prefix || $name =~ /::/;
return $self->{'curstash'}.'::'. $name
if
- $name =~ /^(?!\d|[ab]\z)\w/ # alphabetic (except $a and $b)
+ $name =~ /^(?!\d)\w/ # alphabetic
+ && $v !~ /^\$[ab]\z/ # not $a or $b
&& !$globalnames{$name} # not a global name
&& $self->{hints} & $strict_bits{vars} # strict vars
&& !$self->lex_in_scope($v,1) # no "our"
@@ -4448,7 +4449,7 @@ sub pure_string {
return 0 if null $op;
my $type = $op->name;
- if ($type eq 'const') {
+ if ($type eq 'const' || $type eq 'av2arylen') {
return 1;
}
elsif ($type =~ /^[ul]c(first)?$/ || $type eq 'quotemeta') {
diff --git a/dist/B-Deparse/t/deparse.t b/dist/B-Deparse/t/deparse.t
index 68d33463c1..a7aaa3181d 100644
--- a/dist/B-Deparse/t/deparse.t
+++ b/dist/B-Deparse/t/deparse.t
@@ -20,7 +20,7 @@ BEGIN {
use Test::More;
use Config ();
-plan tests => 129;
+plan tests => 130;
use B::Deparse;
my $deparse = B::Deparse->new();
@@ -784,6 +784,9 @@ pop @_;
my @s;
print /$s[1]/;
####
+# /$#a/
+print /$#main::a/;
+####
# [perl #91318] /regexp/applaud
print /a/a, s/b/c/a;
print /a/aa, s/b/c/aa;