|o||1.0: initial release|
|o||1.1 (26-Feb-2002): Shorter form for short PDLs; more readability|
1.2 (28-Feb-2002): Added deep_copy() exported convenience function
for eval sdump
1.3 (15-May-2002): Added checking for tied objects in gethdr()
[workaround for hole in Data::Dumper]
1.4 (15-Jan-2003): Added support for Convert::UU as well as
Dump a data structure to a string.
sdump dumps a single complex data structure into a string. You restore the data structure by eval-ing the string. Since eval is a builtin, no convenience routine exists to use it.
Dump a data structure to a file
fdump dumps a single complex data structure to a file. You restore the data structure by eval-ing the perl code put in the file. A convenience routine (frestore) exists to do it for you.
I suggest using the extension .pld or (for non-broken OSs) .pdld to distinguish Dumper files. That way they are reminiscent of .pl files for perl, while still looking a little different so you can pick them out. You can certainly feed a dump file straight into perl (for syntax checking) but it will not do much for you, just build your data structure and exit.
Restore a dumped file
frestore() is a convenience function that just reads in the named file and executes it in an eval. Its paired with fdump().
Convenience function copies a complete perl data structure by the brute force method of eval sdump.
Identify whether a PDL is big [Internal routine]
Internal routine takes a PDL and returns a boolean indicating whether its small enough for direct insertion into the dump string. If 0, it can be inserted. Larger numbers yield larger scopes of PDL. 1 implies that it should be broken out but can be handled with a couple of perl commands; 2 implies full uudecode treatment.
PDLs with Astro::FITS::Header objects as headers are taken to be FITS files and are always treated as huge, regardless of size.
Turn a PDL into a 1-part perl expr [Internal routine]
Internal routine that takes a PDL and returns a perl string that evals to the PDL. It should be used with care because it doesnt dump headers and it doesnt check number of elements. The point here is that numbers are dumped with the correct precision for their storage class. Things we dont know about get stringified element-by-element by their builtin class, which is probably not a bad guess.
Recover a PDL from a uuencoded string [Internal routine]
This routine encapsulates uudecoding of the dumped string for large piddles. Its separate to encapsulate the decision about which method of uudecoding to try (both the built-in Convert::UU and the shell command uudecode(1) are supported).
Generate 1- or 2-part expr for a PDL [Internal routine]
Internal routine that produces commands defining a PDL. You supply (<PDL>, <name>) and get back two strings: a prepended command string and an expr that evaluates to the final PDL. PDL is the PDL you want to dump. <inline> is a flag whether dump_PDL is being called inline or before the inline dump string (0 for before; 1 for in). <name> is the name of the variable to be assigned (for medium and large PDLs, which are defined before the dump string and assigned unique IDs).
Walk a data structure and dump PDLs [Internal routine]
Walks the original data structure and generates appropriate exprs for each PDL. The exprs are inserted into the Data::Dumper output string. You shouldnt call this unless you know what youre doing. (see sdump, above).
|perl v5.20.3||DUMPER (3)||2015-08-12|