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 of tick is auto, 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 if quoteHighBit is set, then bestie, they get quoted. ๐Ÿ’…
  • usageOnly โ€” a rudimentary per-package memory usage dump. If you set this, dumpvars goes 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 are unctrl and quote.
  • 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 the get() method and the set() 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