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.


In reply to Re^4: How to save and reload my hash by dcronin135
in thread How to save and reload my hash by lepetitalbert

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.