summaryrefslogtreecommitdiff
path: root/lib/Dumpvalue.pm
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-03-20 21:03:14 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-03-20 21:03:14 +0000
commitfe0660bc2deac19280466637e4f7e41662a5a9e3 (patch)
treed20f4d796575cb91a7d0015a601af24c1ea6336c /lib/Dumpvalue.pm
parent63971e72239aa090db744643be46e3cb80cc4b8d (diff)
downloadperl-fe0660bc2deac19280466637e4f7e41662a5a9e3.tar.gz
make dumpvar.pl recognize emptyness in arrays (from Matthias Urlichs
<smurf@noris.de>); fix up duplicate code in Dumpvalue.pm p4raw-id: //depot/perl@5839
Diffstat (limited to 'lib/Dumpvalue.pm')
-rw-r--r--lib/Dumpvalue.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/Dumpvalue.pm b/lib/Dumpvalue.pm
index 5d3a9dafc2..617494aa15 100644
--- a/lib/Dumpvalue.pm
+++ b/lib/Dumpvalue.pm
@@ -227,9 +227,9 @@ sub unwrap {
if ($self->{compactDump} && !grep(ref $_, @{$v})) {
if ($#$v >= 0) {
$short = $sp . "0..$#{$v} " .
- join(" ",
- map {$self->stringify($_)} @{$v}[0..$tArrayDepth])
- . "$shortmore";
+ join(" ",
+ map {exists $v->[$_] ? $self->stringify $v->[$_] : "empty"} ($[..$tArrayDepth)
+ ) . "$shortmore";
} else {
$short = $sp . "empty array";
}
@@ -238,7 +238,11 @@ sub unwrap {
for my $num ($[ .. $tArrayDepth) {
return if $DB::signal and $self->{stopDbSignal};
print "$sp$num ";
- $self->DumpElem($v->[$num], $s);
+ if (exists $v->[$num]) {
+ $self->DumpElem($v->[$num], $s);
+ } else {
+ print "empty slot\n";
+ }
}
print "$sp empty array\n" unless @$v;
print "$sp$more" if defined $more ;