in reply to Re^3: How to save and reload my hash
in thread How to save and reload my hash
I appreciate the feedback. I did notice something in all the examples I've been able to find regarding Storable and JSON. It has to do with the load from file back to the hash itself. Unless I'm missing something, and that's very possible, there seems to be a missing component of the hash reconstruction from the anonymous hash example %{} illustrated in responding comments. PERL seems to be handling the illusion of the reconstructed hash, until you try and use it in a foreach/keys loop. The assignment becomes a hashref which doesn't seem to fully reconstitute the hash from the file, because I could not get it to work with the foreach/keys loop. It wasn't until I learned about %$ to correct that. Do you see any issues with %$ ? The PERLDOC for Storables warned about the retrieve, would cause some sort of serialization pitfall, thus, causing the foreach/keys not to work. Until %$. The code examples used in the response, served my purpose for a daily PERL script I run at least 20 times a day, and may offer some relief to others trying to reconstitute the hash from a file, so it works as it did before the store.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: How to save and reload my hash
by Your Mother (Archbishop) on Sep 25, 2014 at 15:50 UTC |