diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-20 21:03:14 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-03-20 21:03:14 +0000 |
commit | fe0660bc2deac19280466637e4f7e41662a5a9e3 (patch) | |
tree | d20f4d796575cb91a7d0015a601af24c1ea6336c /lib/Dumpvalue.pm | |
parent | 63971e72239aa090db744643be46e3cb80cc4b8d (diff) | |
download | perl-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.pm | 12 |
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 ; |