This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #123947] deparse $#_ as $#_ not as $#{_}
authorTony Cook <tony@develop-help.com>
Mon, 2 Mar 2015 06:03:12 +0000 (17:03 +1100)
committerTony Cook <tony@develop-help.com>
Mon, 2 Mar 2015 06:03:35 +0000 (17:03 +1100)
8c2e27d changed B::Deparse to deparse $#{1} as that instead of as $#1
which is a syntax error, but also changed $#_ to deparse as $#{_}
which isn't necessary, and broke GFUJI/macro-0.06.tar.gz

This could be considered a bug in macro.pm, but since we don't need to
deparse $#_ as $#{_} let's not do that.

lib/B/Deparse.pm
lib/B/Deparse.t

index c998989..15a1527 100644 (file)
@@ -46,7 +46,7 @@ use B qw(class main_root main_start main_cv svref_2object opnumber perlstring
         MDEREF_SHIFT
     );
 
-$VERSION = '1.33';
+$VERSION = '1.34';
 use strict;
 use vars qw/$AUTOLOAD/;
 use warnings ();
@@ -1724,7 +1724,7 @@ sub stash_variable {
        return "$prefix$name";
     }
 
-    if ($name =~ /^[^[:alpha:]+-]$/) {
+    if ($name =~ /^[^[:alpha:]_+-]$/) {
       if (defined $cx && $cx == 26) {
        if ($prefix eq '@') {
            return "$prefix\{$name}";
index f536284..9805bde 100644 (file)
@@ -1534,7 +1534,7 @@ my @x;
 @x = ($#{`}, $#{~}, $#{!}, $#{@}, $#{$}, $#{%}, $#{^}, $#{&}, $#{*});
 @x = ($#{(}, $#{)}, $#{[}, $#{{}, $#{]}, $#{}}, $#{'}, $#{"}, $#{,});
 @x = ($#{<}, $#{.}, $#{>}, $#{/}, $#{?}, $#{=}, $#+, $#{\}, $#{|}, $#-);
-@x = ($#{;}, $#{:}, $#{1});
+@x = ($#{;}, $#{:}, $#{1}), $#_;
 ####
 # ${#} interpolated
 # It's a known TODO that warnings are deparsed as bits, not textually.