![]() |
Persister - dump Perl variables
|
|
|
NAMEPersister - package to dump Perl variables
SYNOPSISuse Persister; Persister->save( 'filename', \%somehash, 'somehash' ); Persister->save( 'othername', $object, 'object', 1 ); $object = Persister->readXML( 'othername' );
AUTHORRobert Quince (robq@fiendish-demon-co-uk)
DESCRIPTIONThis package allows Perl variables to be dumped to a file
either in a format that can be read straight back into a script
via the It will only dump a reference to a variable, this is so that any type of variable can be passed and treated in the same manner. The passed in reference can be of any of the following types:
* scalar
* array
* hash
* blessed object
The package will also print references to typeglobs, but these
are not dealt with very well as they are references to all
variables of the given name. The output for a glob of the form
The Perl The first line of the output file is an assignment statement of the form:
$<name> = <val>
where the <val> is appropriate to the type of variable referenced,
and <name> is whatever was passed to the The XML mode output file makes use of node reference numbers to handle the circular references during reconstruction. For both output modes tabbed indentation is used to indicate levels of array and hash. If a file name of zero length is given then output will be written
to the
METHODS
|
|
Content of this page Copyright © Robert Quince 1996 - 2005. |