From: Mathieu Arnold Date: Thu, 10 Jun 2004 16:43:58 +0000 (+0200) Subject: Re: [perl #30197] perlbug AutoReply: Data::Dumper does not indent the deparsed code... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=41a63c2f0a70d77b39bfc2320f65e2edb58c6519;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #30197] perlbug AutoReply: Data::Dumper does not indent the deparsed code properly Message-ID: <34D483170C7F84E0DFBE442B@andromede.in.reaumur.net> (with a test adjustment) p4raw-id: //depot/perl@22926 --- diff --git a/ext/Data/Dumper/Dumper.pm b/ext/Data/Dumper/Dumper.pm index 1760381..763a41f 100644 --- a/ext/Data/Dumper/Dumper.pm +++ b/ext/Data/Dumper/Dumper.pm @@ -9,7 +9,7 @@ package Data::Dumper; -$VERSION = '2.121'; +$VERSION = '2.121_01'; #$| = 1; @@ -381,7 +381,7 @@ sub _dump { if ($s->{deparse}) { require B::Deparse; my $sub = 'sub ' . (B::Deparse->new)->coderef2text($val); - $pad = $s->{sep} . $s->{pad} . $s->{xpad} . $s->{apad} . ' '; + $pad = $s->{sep} . $s->{pad} . $s->{apad} . $s->{xpad} x ($s->{level} - 1); $sub =~ s/\n/$pad/gse; $out .= $sub; } else { diff --git a/ext/Data/Dumper/t/dumper.t b/ext/Data/Dumper/t/dumper.t index 92cd3ef..340a539 100755 --- a/ext/Data/Dumper/t/dumper.t +++ b/ext/Data/Dumper/t/dumper.t @@ -960,8 +960,8 @@ TEST q(Data::Dumper->new([[$c, $d]])->Dumpxs;) $WANT = <<'EOT'; #$VAR1 = { # foo => sub { -# print 'foo'; -# } +# print 'foo'; +# } # }; EOT