| CleanCode Perl Libraries |
| Home | Perl Home | Java Home | C# Home | SQL Home | Index | Tools | Download | What's New |
| Multi-Lingual Library | Maintainability | ||||||||||||
![]() |
Perl | ![]() |
Java | ![]() |
JavaScript | ![]() |
Certified Class |
![]() |
Testable Class |
![]() |
Standalone Mode |
![]() |
Diagnostic Enabled |
Data::DumperAbbrev - Data dumper for tables and simple values.
use Data::DumperAbbrev;
$dumper = Data::DumperAbbrev->new();
# concise output
print $dumper->dump($arrayRef)
print $dumper->dump($hashRef)
print $dumper->dump($string)
Perl5.005, Data::Dumper, Data::Handy
This Data::DumperAbbrev class uses standard Data::Dumper
but provides a specialized method to dump abbreviated data structures.
It goes beyond the terse option of Data::Dumper
by limiting array and hash dumps to a certain number of elements.
Current version of this class.
PACKAGE->new(abbreviate)
Creates a Dumper object.
abbreviate - optional; boolean indicating to abbreviate lists or not
a newly created object
Quick Index: dump, setAbbreviate
OBJ->setAbbreviate(abbreviateState)
Sets the boolean abbreviate property of the Dumper object.
abbreviateState - boolean indicating to abbreviate tables and hashes
OBJ->dump(item)
Returns simply formatted copy of the item, possibly abbreviated.
| Item | Returns... |
|---|---|
| Undefined | UNDEF_NAME property (default "(null)") |
| Empty string | EMPTY_NAME property (default "--") |
| String | string unchanged |
| Array reference | Comma-separated list of array elements. |
| Hash reference | Comma-separated list of hash elements, enclosed i n braces. |
If the dumper object has the abbreviate property true,
then, for array and hash references,
just the first 3 elements in the structure are used.
item - any scalar object
simply formatted copy of the item.
None
Michael Sorens
$Revision: 8 $ $Date: 2006-12-19 21:13:43 -0800 (Tue, 19 Dec 2006) $
CleanCode 0.9
Data::Dumper
| Home | Perl Home | Java Home | C# Home | SQL Home | Index | Tools | Download | What's New |
| CleanCode Perl Libraries | Copyright © 2001-2008 Michael Sorens - Revised 2008.07.31 |