From: Alexandr Ciornii Date: Sat, 8 Aug 2009 11:00:30 +0000 (+0200) Subject: Move variable declaration to where it's used X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a36ee16f61a54bdcc1d204777b51b0fd82200363;p=p5sagit%2Fp5-mst-13.2.git Move variable declaration to where it's used --- diff --git a/ext/Data-Dumper/Dumper.pm b/ext/Data-Dumper/Dumper.pm index a112bf7..69aa1dd 100644 --- a/ext/Data-Dumper/Dumper.pm +++ b/ext/Data-Dumper/Dumper.pm @@ -382,7 +382,7 @@ sub _dump { $out .= '\\' . $s->_dump($$val, "*{$name}"); } elsif ($realtype eq 'ARRAY') { - my($v, $pad, $mname); + my($pad, $mname); my($i) = 0; $out .= ($name =~ /^\@/) ? '(' : '['; $pad = $s->{sep} . $s->{pad} . $s->{apad}; @@ -391,7 +391,7 @@ sub _dump { ($name =~ /^\\?[\%\@\*\$][^{].*[]}]$/) ? ($mname = $name) : ($mname = $name . '->'); $mname .= '->' if $mname =~ /^\*.+\{[A-Z]+\}$/; - for $v (@$val) { + for my $v (@$val) { $sname = $mname . '[' . $i . ']'; $out .= $pad . $ipad . '#' . $i if $s->{indent} >= 3; $out .= $pad . $ipad . $s->_dump($v, $sname);