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