Devel::Dumpvar(3pm)
π Devel::Dumpvar π
okay bestie, welcome to Devel::Dumpvar β it lives in the User Contributed Perl Documentation section of the perl man pages, and it's about to make your debugging sessions so much cuter. no cap.
β¨ NAME β¨
Devel::Dumpvar β a pure-OO reimplementation of dumpvar.pl. yes, she's a glow-up of the classic. π
πΈ SYNOPSIS πΈ
use Devel::Dumpvar;
# Dump something immediately to STDOUT
Devel::Dumpvar->dump( [ 'foo' ], $bar' );
# Create a dump handle to use repeatedly
my $Dump = Devel::Dumpvar->new;
# Dump via the handler
$Dump->dump( 'foo', [ 'bar' ] );
π¦ DESCRIPTION π¦
so here's the tea, bestie. most perl dumping modules are out here trying to serialize your data structures into a format you can rebuild back into the exact same data structure. they all have their own lil focus β some care about human readability, some want the dumped code to be directly executable, some wanna keep the dumped data as tiny as possible.
except the one chilling inside the debugger, in the file dumpvar.pl. that one is giving much more human-readable, and it's so useful for debugging β it packs in a whole bunch of extra information without the burden of needing the dump to be reassemblable back into the original data. iconic behavior honestly. π
the main downside of the dumper in the perl-debugger? the dumpvar.pl script isn't really a readily loadable and useable module. it's got dedicated hooks going from and to the debugger, and it spans across multiple namespaces, including main::. messy. π
Devel::Dumpvar is a pure object-orientated reimplementation of that same functionality. which makes it a much more versatile version to use for dumping information to debug log files, or any other use where you don't need to reassemble the data. she's flexible, she's portable, she ate. π
β¨
π METHODS π
new( option => value, ... )
the new constructor creates a new dumping object. any options can be passed a list of key/value pairs. π«Ά
each option passed to the constructor is set via one of the option methods below.
to( $output_destination )
the to option specifies where the output is to be sent to. when undefined, output will go to STDOUT. π¬
the output destination can be either a handle object (or anything else with a ->print method), or the string 'return', which will cause the dump method to collect and return the dump results for each call, rather than printing it immediately to the output.
- if called without an argument, returns the current value. π
- if called with an argument, returns true or dies on error. π
dump( data1, data2, ... )
if called as an object method, dumps a number of data values or structs to the dumping object.
if called as a class method, creates a new default dump object and immediately dumps to it, destroying the dumper afterwards. π¨ (she does her job and she LEAVES.)
π§ TO DO π§
- Implement options currently available in other dumpers as needed.
- Currently only supports
SCALAR,REF,ARRAY,HASHandRegexp. Add support for all possible reference types.
bestie she's still growing okay, let her cook π
π SUPPORT π
bugs should be reported via the CPAN bug tracker at
<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Devel-Dumpvar>
for other issues, or commercial enhancement or support, contact the author. π«Ά
π AUTHORS π
Adam Kennedy <adamk@cpan.org>
π COPYRIGHT π
Copyright 2004 - 2010 Adam Kennedy.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
the full text of the license can be found in the LICENSE file included with this module.
and that's the whole vibe check, bestie π this page was brought to you by perl v5.32.0, dated 2021-01-04, and it's giving Devel::Dumpvar(3pm) main character energy. go dump something cute. periodt. π
β¨
π¦ where this page comes from
- debian bookworm: libdevel-dumpvar-perl 1.06-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libdevel-dumpvar-perl 1.06-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libdevel-dumpvar-perl 1.06-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libdevel-dumpvar-perl 1.06-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms