Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: How to save and reload my hash

by neosamuri (Friar)
on Nov 20, 2005 at 07:17 UTC ( [id://510211]=note: print w/replies, xml ) Need Help??


in reply to How to save and reload my hash

For using data dumper all you havev to do in order to get the data back is use eval to recreate the data structure. Also of note you should also set $Data::Dumper::Purity to 1 if you have nested references

Here is a example:

#Save use Data::Dumper; $Data::Dumper::Purity = 1; open FILE, ">$outfile" or die "Can't open '$outfile':$!"; print FILE Data::Dumper->Dump([$main], ['*main']); close FILE; #restore open FILE, $infile; undef $/; eval <FILE>; close FILE;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-26 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found