summaryrefslogtreecommitdiff
path: root/dist
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-09-17 22:42:58 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-09-17 22:42:58 -0700
commit61154ac0d41ba2a544591a0c8597e503d31abca8 (patch)
tree93f616566d023275011e6258d64a417abbe422d4 /dist
parent6ec73527899164b78a87bc4fc6b180ea6f8087b5 (diff)
downloadperl-61154ac0d41ba2a544591a0c8597e503d31abca8.tar.gz
Deparse "${#}a"
Diffstat (limited to 'dist')
-rw-r--r--dist/B-Deparse/Deparse.pm11
-rw-r--r--dist/B-Deparse/t/deparse.t4
2 files changed, 11 insertions, 4 deletions
diff --git a/dist/B-Deparse/Deparse.pm b/dist/B-Deparse/Deparse.pm
index 7936fcdbf6..28da808c1b 100644
--- a/dist/B-Deparse/Deparse.pm
+++ b/dist/B-Deparse/Deparse.pm
@@ -1297,13 +1297,16 @@ sub stash_variable {
return "$prefix$name";
}
- if (defined $cx && $cx == 26) {
- if ($prefix eq '@' && $name =~ /^[^\w+-]$/) {
+ if ($name =~ /^[^\w+-]$/) {
+ if (defined $cx && $cx == 26) {
+ if ($prefix eq '@') {
return "$prefix\{$name}";
}
- }
- if ($prefix eq '$#' && $name =~ /^[^\w+-]$/) {
+ elsif ($name eq '#') { return '${#}' } # "${#}a" vs "$#a"
+ }
+ if ($prefix eq '$#') {
return "\$#{$name}";
+ }
}
my $v = ($prefix eq '$#' ? '@' : $prefix) . $name;
diff --git a/dist/B-Deparse/t/deparse.t b/dist/B-Deparse/t/deparse.t
index 92f8ae0857..e527b99a33 100644
--- a/dist/B-Deparse/t/deparse.t
+++ b/dist/B-Deparse/t/deparse.t
@@ -772,3 +772,7 @@ my @x;
@x = ($#{(}, $#{)}, $#{[}, $#{{}, $#{]}, $#{}}, $#{'}, $#{"}, $#{,});
@x = ($#{<}, $#{.}, $#{>}, $#{/}, $#{?}, $#{=}, $#+, $#{\}, $#{|}, $#-);
@x = ($#{;}, $#{:});
+####
+# ${#} interpolated (the first line magically disables the warning)
+() = *#;
+() = "${#}a";