From 6ec73527899164b78a87bc4fc6b180ea6f8087b5 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sat, 17 Sep 2011 22:39:17 -0700 Subject: [PATCH] Deparse $#{/} correctly --- dist/B-Deparse/Deparse.pm | 3 +++ dist/B-Deparse/t/deparse.t | 7 +++++++ pod/perldelta.pod | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/dist/B-Deparse/Deparse.pm b/dist/B-Deparse/Deparse.pm index abe18a8..7936fcd 100644 --- a/dist/B-Deparse/Deparse.pm +++ b/dist/B-Deparse/Deparse.pm @@ -1302,6 +1302,9 @@ sub stash_variable { return "$prefix\{$name}"; } } + if ($prefix eq '$#' && $name =~ /^[^\w+-]$/) { + return "\$#{$name}"; + } my $v = ($prefix eq '$#' ? '@' : $prefix) . $name; return $prefix .$self->{'curstash'}.'::'. $name if $self->lex_in_scope($v); diff --git a/dist/B-Deparse/t/deparse.t b/dist/B-Deparse/t/deparse.t index f8b52ed..92f8ae0 100644 --- a/dist/B-Deparse/t/deparse.t +++ b/dist/B-Deparse/t/deparse.t @@ -765,3 +765,10 @@ CORE::given ($x) { CORE::break; } } +#### +# $#- $#+ $#{%} etc. +my @x; +@x = ($#{`}, $#{~}, $#{!}, $#{@}, $#{$}, $#{%}, $#{^}, $#{&}, $#{*}); +@x = ($#{(}, $#{)}, $#{[}, $#{{}, $#{]}, $#{}}, $#{'}, $#{"}, $#{,}); +@x = ($#{<}, $#{.}, $#{>}, $#{/}, $#{?}, $#{=}, $#+, $#{\}, $#{|}, $#-); +@x = ($#{;}, $#{:}); diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 178738a..25ef87c 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -172,6 +172,12 @@ L has been upgraded from version 1.76 to version 1.78. =item * +L has been upgraded from version 1.07 to 1.08. + +It now correctly deparses C<$#{/}>. + +=item * + L has been upgraded from version 2.112150 to version 2.112580. =item * -- 2.7.4