summaryrefslogtreecommitdiff
path: root/lib/Dumpvalue.pm
diff options
context:
space:
mode:
authorchromatic <chromatic@wgz.org>2001-09-22 13:41:31 -0600
committerAbhijit Menon-Sen <ams@wiw.org>2001-09-23 06:36:26 +0000
commit8f90a6c70b6a5c1aca24608b06b7deecb45f7079 (patch)
tree12b540575cfbed09c0ae00a611834f88480e72e0 /lib/Dumpvalue.pm
parent19eb373927c15d5437342c078008f4431ea54fd9 (diff)
downloadperl-8f90a6c70b6a5c1aca24608b06b7deecb45f7079.tar.gz
Add tests for
Dumpvalue.pm Message-Id: <20010923014628.7739.qmail@onion.perl.org> p4raw-id: //depot/perl@12150
Diffstat (limited to 'lib/Dumpvalue.pm')
-rw-r--r--lib/Dumpvalue.pm26
1 files changed, 17 insertions, 9 deletions
diff --git a/lib/Dumpvalue.pm b/lib/Dumpvalue.pm
index 427f57cc42..c9b1acafeb 100644
--- a/lib/Dumpvalue.pm
+++ b/lib/Dumpvalue.pm
@@ -1,9 +1,10 @@
use 5.006_001; # for (defined ref) and $#$v and our
package Dumpvalue;
use strict;
-our $VERSION = '1.00';
+our $VERSION = '1.10';
our(%address, $stab, @stab, %stab, %subs);
+# documentation nits, handle complex data structures better by chromatic
# translate control chars to ^X - Randal Schwartz
# Modifications to print types by Peter Gordon v1.0
@@ -428,7 +429,14 @@ EOP
sub scalarUsage {
my $self = shift;
- my $size = length($_[0]);
+ my $size;
+ if (UNIVERSAL::isa($_[0], 'ARRAY')) {
+ $size = $self->arrayUsage($_[0]);
+ } elsif (UNIVERSAL::isa($_[0], 'HASH')) {
+ $size = $self->hashUsage($_[0]);
+ } elsif (!ref($_[0])) {
+ $size = length($_[0]);
+ }
$self->{TotalStrings} += $size;
$self->{Strings}++;
$size;
@@ -511,28 +519,28 @@ may be printed on one line.
Whether to print contents of globs.
-=item C<DumpDBFiles>
+=item C<dumpDBFiles>
Dump arrays holding contents of debugged files.
-=item C<DumpPackages>
+=item C<dumpPackages>
Dump symbol tables of packages.
-=item C<DumpReused>
+=item C<dumpReused>
Dump contents of "reused" addresses.
-=item C<tick>, C<HighBit>, C<printUndef>
+=item C<tick>, C<quoteHighBit>, C<printUndef>
Change style of string dump. Default value of C<tick> is C<auto>, one
can enable either double-quotish dump, or single-quotish by setting it
to C<"> or C<'>. By default, characters with high bit set are printed
-I<as is>.
+I<as is>. If C<quoteHighBit> is set, they will be quoted.
-=item C<UsageOnly>
+=item C<usageOnly>
-I<very> rudimentally per-package memory usage dump. If set,
+rudimentally per-package memory usage dump. If set,
C<dumpvars> calculates total size of strings in variables in the package.
=item unctrl