Dumpvalue(3pm)

πŸ’– NAME πŸ’–

okay bestie, this is Dumpvalue from the Perl Programmers Reference Guide β€” the 3pm one β€” and it provides screen dump of Perl data. literally its 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 🧚

A new dumper is created by a call

  $d = Dumpvalue->new(option1 => value1, option2 => value2)

Recognized options:

  • "arrayDepth", "hashDepth" β€” print only first N elements of arrays and hashes. If false, prints all the elements.
  • "compactDump", "veryCompact" β€” change style of array and hash dump. If true, short array may be printed on one line.
  • "globPrint" β€” whether to print contents of globs.
  • "dumpDBFiles" β€” dump arrays holding contents of debugged files.
  • "dumpPackages" β€” dump symbol tables of packages.
  • "dumpReused" β€” dump contents of "reused" addresses.
  • "tick", "quoteHighBit", "printUndef" β€” change style of string dump. Default value of "tick" is "auto", one can enable either double-quotish dump, or single-quotish by setting it to """ or "'". By default, characters with high bit set are printed as is. If "quoteHighBit" is set, they will be quoted.
  • "usageOnly" β€” rudimentary per-package memory usage dump. If set, "dumpvars" calculates total size of strings in variables in the package.
  • unctrl β€” changes the style of printout of strings. Possible values are "unctrl" and "quote".
  • subdump β€” whether to try to find the subroutine name given the reference.
  • bareStringify β€” whether to write the non-overloaded form of the stringify-overloaded objects.
  • quoteHighBit β€” whether to print chars with high bit set in binary or "as is". yes bestie, it gets a second lil bullet β€” the original said it twice and we respect the lore 🫢
  • stopDbSignal β€” whether to abort printing if debugger signal flag is raised.

Later in the life of the object the methods may be queried with the get() method and the set() method (which accept multiple arguments).


πŸ¦‹ Methods πŸ¦‹

πŸ’« dumpValue πŸ’«

$dumper->dumpValue($value);
$dumper->dumpValue([$value1, $value2]);

Prints a dump to the currently selected filehandle.

πŸ’« dumpValues πŸ’«

$dumper->dumpValues($value1, $value2);

Same as $dumper->dumpValue([$value1, $value2]);.

πŸ’« stringify πŸ’«

my $dump = $dumper->stringify($value [,$noticks] );

Returns the dump of a single scalar without printing. If the second argument is true, the return value does not contain enclosing ticks. Does not handle data structures β€” no cap, that's literally the limit.

πŸ’« dumpvars πŸ’«

$dumper->dumpvars('my_package');
$dumper->dumpvars('my_package', 'foo', '~bar$', '!......');

The optional arguments are considered as literal strings unless they start with ~ or !, in which case they are interpreted as regular expressions (possibly negated).

The second example prints entries with names foo, and also entries with names which ends on bar, or are shorter than 5 chars.

πŸ’« set_quote πŸ’«

$d->set_quote('"');

Sets tick and unctrl options to suitable values for printout with the given quote char. Possible values are "auto", "'" and "".

πŸ’« set_unctrl πŸ’«

$d->set_unctrl('unctrl');

Sets unctrl option with checking for an invalid argument. Possible values are "unctrl" and "quote".

πŸ’« compactDump πŸ’«

$d->compactDump(1);

Sets compactDump option. If the value is 1, sets to a reasonable big number.

πŸ’« veryCompact πŸ’«

$d->veryCompact(1);

Sets compactDump and veryCompact options simultaneously.

πŸ’« set πŸ’«

$d->set(option1 => value1, option2 => value2);

πŸ’« get πŸ’«

@values = $d->get('option1', 'option2');

okay that's the whole Dumpvalue moment πŸ’– this page is Dumpvalue(3pm) from perl v5.42.3, dated 2026-11-03 β€” periodt, go dump something cute ✨

πŸ“¦ where this page comes from