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 | d918263624f69db4f9575643879bfa5b4453117e (patch) | |
tree | d20f4d796575cb91a7d0015a601af24c1ea6336c /lib/dumpvar.pl | |
parent | 36392fcf0bb917360f3e083a8d5bb2f65f72c346 (diff) | |
download | perl-d918263624f69db4f9575643879bfa5b4453117e.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/dumpvar.pl')
-rw-r--r-- | lib/dumpvar.pl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/dumpvar.pl b/lib/dumpvar.pl index 4a3041a02b..51e9c88ea3 100644 --- a/lib/dumpvar.pl +++ b/lib/dumpvar.pl @@ -195,8 +195,8 @@ sub unwrap { if ($#$v >= 0) { $short = $sp . "0..$#{$v} " . join(" ", - map {stringify $_} @{$v}[0..$tArrayDepth]) - . "$shortmore"; + map {exists $v->[$_] ? stringify $v->[$_] : "empty"} ($[..$tArrayDepth) + ) . "$shortmore"; } else { $short = $sp . "empty array"; } @@ -209,7 +209,11 @@ sub unwrap { for $num ($[ .. $tArrayDepth) { return if $DB::signal; print "$sp$num "; - DumpElem $v->[$num], $s; + if (exists $v->[$num]) { + DumpElem $v->[$num], $s; + } else { + print "empty slot\n"; + } } print "$sp empty array\n" unless @$v; print "$sp$more" if defined $more ; |