: I'm looking for the best way to store an array or hash in a file on disc,
: so it can be picked up by another cgi. 
: 
: I'm currently storing to a file where every line contains an element
: (and I know that every 6 lines contain a column in my array). But I find
: this rather...hmmm....not so elegant. 
: 
: Isn't their a sort of "hash dump" that will encapsulate the whole hash
: and dump it in binary on the disc - so that it can be simply read in
: again directly within a hash? 

There are several modules that do things like this:

FreezeThaw   - converts structures to strings; kind of old
Data::Dumper - stores & recovers data structures as ASCII
Storable     - stores & recovers data structures or objects
WDDX         - stores & recovers parameter sets as XML

Also, if what you want to save is the CGI parameters, CGI.pm has a
save() method that will save the parameters to an open filehandle;
another script can recover them.

-- tdk

Reply via email to