1Devel::Dumpvar(3) User Contributed Perl Documentation Devel::Dumpvar(3)
2
3
4
6 Devel::Dumpvar - A pure-OO reimplementation of dumpvar.pl
7
9 use Devel::Dumpvar;
10
11 # Dump something immediately to STDOUT
12 Devel::Dumpvar->dump( [ 'foo' ], $bar' );
13
14 # Create a dump handle to use repeatedly
15 my $Dump = Devel::Dumpvar->new;
16
17 # Dump via the handler
18 $Dump->dump( 'foo', [ 'bar' ] );
19
21 Most perl dumping modules are focused on serializing data structures
22 into a format that can be rebuilt into the original data structure.
23 They do this with a variety of different focuses, such as human
24 readability, the ability to execute the dumped code directly, or to
25 minimize the size of the dumped data.
26
27 Excect for the one contained in the debugger, in the file dumpvar.pl.
28 This is a much more human-readable form, highly useful for debugging,
29 containing a lot of extra information without the burden of needing to
30 allow the dump to be re-assembled into the original data.
31
32 The main downside of the dumper in the perl-debugger is that the
33 dumpvar.pl script is not really a readily loadable and useable module.
34 It has dedicated hooks from and to the debugger, and spans across
35 multiple namespaces, including main::.
36
37 Devel::Dumpvar is a pure object-orientated reimplementation of the same
38 functionality. This makes it much more versatile version to use for
39 dumping information to debug log files or other uses where you don't
40 need to reassemble the data.
41
43 new( option => value, ... )
44 The "new" constructor creates a new dumping object. Any options can be
45 passed a list of key/value pairs.
46
47 Each option passed to the constructor is set via one of the option
48 methods below.
49
50 to( $output_destination )
51 The "to" option specifies where the output is to be sent to. When
52 undefined, output will go to STDOUT. The output destination can be
53 either a handle object ( or anything else with a ->print method ), or
54 the string 'return', which will cause the "dump" method to collect and
55 return the dump results for each call, rather than printing it
56 immediately to the output.
57
58 If called without an argument, returns the current value. If called
59 with an argument, returns true or dies on error.
60
61 dump( data1, data2, ... )
62 If called as an object method, dumps a number of data values or structs
63 to the dumping object. If called as a class method, creates a new
64 default dump object and immediately dumps to it, destroying the dumper
65 afterwards.
66
68 - Implement options currently available in other dumpers as needed.
69
70 - Currently only supports SCALAR, REF, ARRAY, HASH and Regexp.
71 Add support for all possible reference types.
72
74 Bugs should be reported via the CPAN bug tracker at
75
76 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Devel-Dumpvar>
77
78 For other issues, or commercial enhancement or support, contact the
79 author.
80
82 Adam Kennedy <adamk@cpan.org>
83
85 Copyright 2004 - 2010 Adam Kennedy.
86
87 This program is free software; you can redistribute it and/or modify it
88 under the same terms as Perl itself.
89
90 The full text of the license can be found in the LICENSE file included
91 with this module.
92
93
94
95perl v5.32.0 2020-07-28 Devel::Dumpvar(3)