The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

DD - Dump data structure for debugging

VERSION

This document describes version 0.007 of DD (from Perl distribution DD-Dummy), released on 2019-08-12.

SYNOPSIS

To install this module, currently do this:

 % cpanm -n DD::Dummy

In your code:

 use DD; # exports dd(), dd_warn(), dd_die(), dmp()
 ...
 dd $data                ; # prints data to STDOUT, return argument
 my $foo = dd $data      ; # ... so you can use it inside expression
 my $foo = dd_warn $data ; # just like dd() but warns instead
 dd_die $data            ; # just like dd() but dies instead

 my $dmp = dmp $data     ; # dump data as string and return it

On the command-line:

 % perl -MDD -E'...; dd $data; ...'

DESCRIPTION

DD is a module with a short name you can use for debugging. It provides "dd" which dumps data structure to STDOUT, as well as return the original data so you can insert dd in the middle of expressions. It also provides "dd_warn", "dd_die", as well as "dmp" for completeness.

DD can use several kinds of backends. The default is Data::Dump which is chosen because it's a mature module and produces visually nice dumps for debugging. You can also use these other backends:

PACKAGE VARIABLES

$BACKEND

The backend to use. The default is to use "PERL_DD_BACKEND" environment variable or "Data::Dump" as the fallback default.

FUNCTIONS

dd

Print the dump of its arguments to STDOUT, and return its arguments.

dd_warn

Warn the dump of its arguments, and return its arguments. If you want a full stack trace, you can use Devel::Confess, e.g. on the command-line:

 % perl -d:Confess -MDD -E'... dd_warn $data;'

dd_die

Die with the dump of its arguments as message. If you want a full stack trace, you can use Devel::Confess, e.g. on the command-line:

 % perl -d:Confess -MDD -E'... dd_die $data;'

dmp

Dump its arguments as string and return it.

ENVIRONMENT

PERL_DD_BACKEND

Can be used to set the default backend.

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/DD-Dummy.

SOURCE

Source repository is at https://github.com/perlancar/perl-DD-Dummy.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=DD-Dummy

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

SEE ALSO

XXX - basically the same thing but with different function names and defaults. I happen to use "XXX" to mark todo items in source code, so I prefer other names.

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2019, 2017 by perlancar@cpan.org.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.