SYNOPSIS

     use Data::Dmp; # exports dd() and dmp()
     dd [1, 2, 3]; # prints "[1,2,3]"
     $a = dmp({a => 1}); # -> "{a=>1}"

DESCRIPTION

    Data::Dmp is a Perl dumper like Data::Dumper. It's compact (only about
    120 lines of code long), starts fast and does not use other module
    except Regexp::Stringify when dumping regexes. It produces compact
    output (similar to Data::Dumper::Concise). It roughly has the same
    speed as Data::Dumper (usually a bit faster for smaller structures),
    but does not offer the various formatting options. It supports dumping
    objects, regexes, circular structures. Its code is based on Data::Dump.

    It currently does not support "deparse" like Data::Dumper and dumps
    coderefs as sub{'DUMMY'}. Unlike Data::Dump, it currently does not
    support identifying tied data or globs.

FUNCTIONS

 dd($data, ...) => $data ...

    Exported by default. Like Data::Dump's dd (a.k.a. dump), print one or
    more data to STDOUT. Unlike Data::Dump's dd, it always prints and
    return the original data (like XXX), making it convenient to insert
    into expressions. This also removes ambiguity and saves one wantarray()
    call.

 dmp($data, ...) => $str

    Exported by default. Return dump result as string. Unlike Data::Dump's
    dd (a.k.a. dump), it never prints and only return the data.

SETTINGS

 $Data::Dmp::OPT_PERL_VERSION => str

    Set target Perl version. Currently this is used when passing to
    Regexp::Stringify. If you set this to, say 5.010, then the dumped code
    will keep compatibility with Perl 5.10.0.

BENCHMARKS

    # COMMAND: devscripts/bench

FAQ

 When to use Data::Dmp? How does it compare to other dumper modules?

    Data::Dmp might be suitable for you if you want a relatively fast
    pure-Perl data structure dumper to eval-able Perl code. It produces
    compact, single-line Perl code but offers little/no formatting options.
    Data::Dmp and Data::Dump module family usually produce Perl code that
    is "more eval-able", e.g. it can recreate circular structure.

    Data::Dump produces nicer output (some alignment, use of range operator
    to shorten lists, use of base64 for binary data, etc) but no built-in
    option to produce compact/single-line output. It's also relatively
    slow. I usually use its variant, Data::Dump::Color, for console
    debugging.

    Data::Dumper is core module, offers a lot of formatting options (like
    disabling hash key sorting, setting verboseness/indent level, and so
    on) but you usually have to configure it quite a bit before it does
    exactly like you want (that's why there are modules on CPAN that are
    just wrapping Data::Dumper with some configuration, like
    Data::Dumper::Concise et al). It does not support dumping Perl code
    that can recreate circular structures.

    Of course, dumping to eval-able Perl code is slow (not to mention the
    cost of re-loading the code back to in-memory data, via eval-ing)
    compared to dumping to JSON, YAML, Sereal, or other format. So you need
    to decide first whether this is the appropriate route you want to take.
    (But note that there is also Data::Dumper::Limited and Data::Undump
    which uses a format similar to Data::Dumper but lets you load the
    serialized data without eval-ing them, thus achieving the speed
    comparable to JSON::XS).

SEE ALSO

    Data::Dump and other variations/derivate works in Data::Dump::*.

    Data::Dumper and its variants.

    Data::Printer.

    YAML, JSON, Storable, Sereal, and other serialization formats.

