32.10. Data::Dumperuse Data::Dumper; print Dumper($store); When used on the example from Class::Struct, this prints:
The Data::Dumper module's Dumper
function takes a list of scalars (including references, which can even
refer to objects) and returns a printable or
evalable string that accurately reproduces an
faithful copy of the original. You could use this to write out a
saved version of a data structure to a regular disk file or into a DBM
file, or to pass it to another process over a pipe or socket
connection. This module can be used with MLDBM
from CPAN and DB_File to implement a DBM file that
can transparently store complex data values, not just flat strings.
Other stringification (or serialization, or
marshalling) modules include
Storable and FreezeThaw, both
available from CPAN.
![]() Copyright © 2002 O'Reilly & Associates. All rights reserved. |
|