Personal tools
Skip to content. | Skip to navigation
Given a list of scalars or reference variables, writes out their contents in perl syntax. The references can also be objects. The content of each variable is output in a single Perl statement. Handles self-referential structures correctly.
This module always exports a single function, Dumper, which can be called with an array of values to dump those values or with no arguments to return the Data::Dumper object it has created. It exists, fundamentally, as a convenient way to reproduce a set of Dumper options that we've found ourselves using across large numbers of applications.
Hashes are great for storing named data, but if you want more than one entry for a name, you have to use a list of pairs. Even then, this is really boring to write:
Hashes are great for storing named data, but if you want more than one entry for a name, you have to use a list of pairs. Even then, this is really boring to write: $values = [ foo => undef, bar => undef, baz => undef, xyz => { ... }, ]; With Data::OptList, you can do this instead: $values = Data::OptList::mkopt([ qw(foo bar baz), xyz => { ... }, ]); This works by assuming that any defined scalar is a name and any reference following a name is its value.
Data::Perl is a collection of classes that wrap fundamental data types that exist in Perl. These classes and methods as they exist today are an attempt to mirror functionality provided by Moose's Native Traits. One important thing to note is all classes currently do no validation on constructor input.
Data::Section provides an easy way to access multiple named chunks of line-oriented data in your module's DATA section. It was written to allow modules to store their own templates, but probably has other uses.
Data::Dumper and other modules do a great job of dumping data structures. Their output, however, often takes more brain power to understand than the data itself. When dumping large amounts of data, the output can be overwhelming and it can be difficult to see the relationship between each piece of the dumped data. Data::TreeDumper also dumps data in a tree-like fashion but hopefully in a format more easily understood.