Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Saving and Loading of Variables

by zigdon (Deacon)
on Jul 18, 2006 at 14:50 UTC ( [id://562034]=note: print w/replies, xml ) Need Help??


in reply to Saving and Loading of Variables

FreezeThaw, Storable, and Data::Dumper could all be used here - just write the serialized data to a file when the program ends, and read it back when it starts up:
use FreezeThaw qw/freeze thaw/; my $dataStruct; if (open(DATA, "frozen.data")) { my $ice = <DATA>; ($dataStruct) = thaw($ice); close DATA; } # .... do some stuff with $dataStruct open (DATA, ">", "frozen.data") or die "Failed to write: $!"; print DATA freeze($dataStruct); close DATA;

-- zigdon

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2024-04-18 07:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found