Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Storable: freeze/unfreeze

by Maclir (Curate)
on Oct 15, 2001 at 21:39 UTC ( [id://118948]=note: print w/replies, xml ) Need Help??


in reply to Storable: freeze/unfreeze

I won't comment on your trying to "roll your own" CGI processing, ignoring the CGI.pm module. There have only been 1,000,000 posts on PM advising peoplenot to do this, so why add another?

Regarding the use of storable, my understanding is the module works on references to a data structure. You may want to check out some examples in the Perl Cookbook (pages 388 onwards. Now I have not used the "freeze / thaw" functions, but basically the process works like this:

my %complex_hash = (); # now stick stuff in the hash store (\%complex_hash, '/some/file/name'); # notice the use of the backslash, meaning you pass a reference # later on . . . $complex_hash_ref = retrieve('/some/file/name'); # or even %complex_hash = %( retrieve('/some/file/name');
As I said, I dont know about nfreeze / thaw, but it may also require you pass a reference to the data structure, and thaw may return a reference.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://118948]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-25 11:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found