NAME

Devel::PartialDump - Partial dumping of data structures, optimized for argument printing.

SYNOPSIS

use Devel::PartialDump;

sub foo {
	print "foo called with args: " . Devel::PartialDump->new->dump(@_);
}

DESCRIPTION

This module is a data dumper optimized for logging of arbitrary parameters.

It attempts to truncate overly verbose data, be

ATTRIBUTES

max_length

The maximum character length of the dump.

Anything bigger than this will be truncated.

Not defined by default.

max_elements

The maximum number of elements (array elements or pairs in a hash) to print.

Defualts to 6.

max_depth

The maximum level of recursion.

Defaults to 2.

stringify

Whether or not to let objects stringify themeslves, instead of using "StrVal" in overload to avoid sideffects.

Defaults to false (no overloading).

pairs

Whether or not to autodetect named args as pairs in the main dump function. If this attribute is true, and the top level value list is even sized, and every odd element is not a reference, then it will dumped as pairs instead of a list.

METHODS

dump @stuff

Returns a one line, human readable, concise dump of @stuff.

dump_as_list $depth, @stuff
dump_as_pairs $depth, @stuff

Dump @stuff using the various formatting functions.

Dump as pairs returns comma delimited pairs with => between the key and the value.

Dump as list returns a comma delimited dump of the values.

frmat $depth, $value
format_key $depth, $key
format_object $depth, $object
format_ref $depth, $Ref
format_array $depth, $array_ref
format_hash $depth, $hash_ref
format_undef $depth, undef
format_string $depth, $string
format_number $depth, $number
quote $string

The various formatting methods.

You can override these to provide a custom format.

format_array and format_hash recurse with $depth + 1 into dump_as_list and dump_as_pairs respectively.

format_ref delegates to format_array and format_hash and does the max_depth tracking. It will simply stringify the ref if the recursion limit has been reached.

VERSION CONTROL

This module is maintained using Darcs. You can get the latest version from http://nothingmuch.woobling.org/code, and use darcs send to commit changes.

AUTHOR

Yuval Kogman <nothingmuch@woobling.org>

COPYRIGHT

Copyright (c) 2008 Yuval Kogman. All rights reserved
This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.