Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Saving and Loading of Variables

by zigdon (Deacon)
on Jul 18, 2006 at 14:50 UTC ( #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
Node Status?
node history
Node Type: note [id://562034]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2019-07-17 11:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?