Perl: the Markov chain saw | |
PerlMonks |
Re: How to save and reload my hashby dcronin135 (Acolyte) |
on Sep 23, 2014 at 02:44 UTC ( [id://1101591]=note: print w/replies, xml ) | Need Help?? |
I ran into this problem, and was very frustrated with the provided examples in getting this to work correctly. Especially on the retrieve, because I could not get the foreach/keys loop to work with the hash after the retrieve. The hash would populate, and could manually plug in the hash of hash values, but, it would not work with the foreach/keys loop. So a peer of mine suggested I try converting the hashref to a hash via %$ construct. I had not seen this before. It worked! After a few trials looking at the hash with Data::Dumper, I was able to get this working using only the Storable module. So now the retrieve side works with the foreach/keys loop. I also provided a JSON example. Yeah !!!
Script #2
JSON version
In Section
Seekers of Perl Wisdom
|
|