ASPN ActiveState Programmer Network
  ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups | Web Services
SEARCH
advanced | search help

Reference
ActivePerl 5.8
Modules
ActivePerl
ActiveState
AnyDBM File
Apache
Archive
Attribute
AutoLoader
AutoSplit
B
Benchmark
Bundle
ByteLoader
Carp
CGI
Class
Compress
Config
CPAN
Cwd
Data
Dump
Dumper
DB
DBD
DBI
DBM Filter
DB File
Devel
Digest
DirHandle
Dumpvalue
DynaLoader
Encode
English
Env
Errno
Exporter
ExtUtils
Fatal
Fcntl
File
FileCache
FileHandle
Filter
FindBin
Font
GDBM File
Getopt
Hash
HTML
HTTP
I18N
IO
IPC
List
Locale
LWP
lwpcook
lwptut
Mac
MacPerl
Math
MD5
Memoize
MIME
MLDBM
Module
NDBM File
Net
NEXT
O
Opcode
perl5db
PerlEx
PerlIO
perllocal
Pod
POSIX
Roadmap
Safe
Scalar
SDBM File
Search
SelectSaver
SelfLoader
Shell
SOAP
Socket
Storable
Switch
Symbol
Sys
TASKS
Tcl
Term
Test
Text
Thread
Tie
Time
Tk
Tkx
UDDI
Unicode
UNIVERSAL
URI
User
Win32
Win32API
Win32CORE
WWW
XML
XMLRPC
XSLoader

MyASPN >> Reference >> ActivePerl 5.8 >> Modules
ActivePerl 5.8 documentation

NAME

Data::Dump - Pretty printing of data structures


SYNOPSIS

 use Data::Dump qw(dump);
 $str = dump(@list)
 @copy_of_list = eval $str;


DESCRIPTION

This module provides a single function called dump() that takes a list of values as its argument and produces a string as its result. The string contains Perl code that, when evaled, produces a deep copy of the original arguments. The string is formatted for easy reading.

If dump() is called in a void context, then the dump is printed on STDERR instead of being returned.

If you don't like importing a function that overrides Perl's not-so-useful builtin, then you can also import the same function as pp(), mnemonic for "pretty-print".


HISTORY

The Data::Dump module grew out of frustration with Sarathy's in-most-cases-excellent Data::Dumper. Basic ideas and some code are shared with Sarathy's module.

The Data::Dump module provides a much simpler interface than Data::Dumper. No OO interface is available and there are no configuration options to worry about (yet :-). The other benefit is that the dump produced does not try to set any variables. It only returns what is needed to produce a copy of the arguments. This means that dump("foo") simply returns "foo", and dump(1..5) simply returns (1, 2, 3, 4, 5).


SEE ALSO

the Data::Dumper manpage, the Storable manpage


AUTHORS

The Data::Dump module is written by Gisle Aas <gisle@aas.no>, based on Data::Dumper by Gurusamy Sarathy <gsar@umich.edu>.

 Copyright 1998-2000,2003-2004 Gisle Aas.
 Copyright 1996-1998 Gurusamy Sarathy.

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


Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState 2004 All rights reserved