Dumpvalue(3perl)
๐ธ NAME ๐ธ
Dumpvalue โ bestie, it hands you a whole screen dump of your Perl data. That's it, that's the whole job. ๐
โจ SYNOPSIS โจ
use Dumpvalue;
my $dumper = Dumpvalue->new;
$dumper->set(globPrint => 1);
$dumper->dumpValue(\*::);
$dumper->dumpvars('main');
my $dump = $dumper->stringify($some_value);
๐ DESCRIPTION ๐
๐ Creation ๐
You birth a fresh dumper with one little call, no cap:
$d = Dumpvalue->new(option1 => value1, option2 => value2)
And here's every option it recognizes, all of them, I'm not skipping a single one because I am obsessed with completeness:
arrayDepth,hashDepthโ only print the first N elements of arrays and hashes. Set them false and you get literally everything, every last element, no filter. ๐compactDump,veryCompactโ switches up the style of your array and hash dump. If it's true, a short array might get squeezed onto one single line. Cute, efficient. โจglobPrintโ do we print the contents of globs or not. That's the whole question. ๐ซถdumpDBFilesโ dumps the arrays that hold the contents of debugged files.dumpPackagesโ dumps symbol tables of packages.dumpReusedโ dumps the contents of "reused" addresses.tick,quoteHighBit,printUndefโ all about changing the style of your string dump. The default value oftickisauto, and you can switch on either a double-quotish dump or a single-quotish one by setting it to"or'. By default, characters with the high bit set get printed as is. But ifquoteHighBitis set, then bestie, they get quoted. ๐usageOnlyโ a rudimentary per-package memory usage dump. If you set this,dumpvarsgoes and calculates the total size of strings in the variables in the package. ๐งฎunctrlโ changes the style of the printout of strings. The possible values areunctrlandquote.subdumpโ whether it should try to find the subroutine name given the reference. detective energy ๐bareStringifyโ whether to write the non-overloaded form of the stringify-overloaded objects.quoteHighBitโ whether to print chars with the high bit set in binary, or "as is".stopDbSignalโ whether to abort printing if the debugger signal flag is raised.
And later on in the life of the object, you can query all these with theget()method and theset()method โ and yes, both of those accept multiple arguments. Multi-arg queens. ๐
๐ฆ Methods ๐ฆ
dumpValue
$dumper->dumpValue($value);
$dumper->dumpValue([$value1, $value2]);
Prints a dump to the currently selected filehandle.
dumpValues
$dumper->dumpValues($value1, $value2);
Exactly the same as $dumper->dumpValue([$value1, $value2]);. Same vibe, slightly different syntax. ๐
stringify
my $dump = $dumper->stringify($value [,$noticks] );
Returns the dump of a single scalar and does not print it. If that second argument is true, the return value does not contain enclosing ticks. Heads up though โ it does not handle data structures. One scalar only, she's simple like that. ๐
dumpvars
$dumper->dumpvars('my_package');
$dumper->dumpvars('my_package', 'foo', '~bar$', '!......');
The optional arguments get treated as literal strings โ unless they start with ~ or !, in which case they're interpreted as regular expressions (and yes, possibly negated). ๐
So that second example up there prints entries with the names foo, plus entries whose names end on bar, plus entries whose names are shorter than 5 chars.
set_quote
$d->set_quote('"');
Sets the tick and unctrl options to suitable values for a printout with the given quote char. Possible values are auto, ' and ". Pick your fighter. โจ
set_unctrl
$d->set_unctrl('unctrl');
Sets the unctrl option, and it checks for an invalid argument while it's at it. Possible values are unctrl and quote.
compactDump
$d->compactDump(1);
Sets the compactDump option. If the value is 1, it sets it to a reasonable big number. โจ
veryCompact
$d->veryCompact(1);
Sets the compactDump and veryCompact options simultaneously. Two for one, we love a bundle deal. ๐
set
$d->set(option1 => value1, option2 => value2);
get
@values = $d->get('option1', 'option2');
And that's the whole page, bestie โ go dump some data and look iconic doing it. ๐ โจ
Kisses from the Perl Programmers Reference Guide, where this page lives as Dumpvalue(3perl) โ perl v5.44.0, dated 2026-10-17. Byeee ๐ซถ๐ธ
๐ฆ where this page comes from
- arch rolling: perl 5.44.0-1 ยท Artistic-1.0-Perl AND 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