I'm using
use diagnostics
and very occasionally I get a
Use of uninitialized value in hash dereference at ....
message.

Basically, I have a background task that is accumulating information into a hash. This hash is then transacted back to the parent.
I'm using Data::Dumper to convert the hash in the background task into a string.
Once this string is received (by the parent), I then convert the string back into a hash with:
my %info   = %{ eval $dumper };
And it is this line that generates the "uninitialized value" message.
(The background task sends data back to the parent every 10 seconds, and the "uninitialized warning" message is only genereted once in 2-3 weeks).

Before executing the line above, I do check that $dumper contians $VAR1=.
I'm struggling to find out what it is about the original hash that is being packed by Data::Dumper that might cause this "uninitialized value" message.
One line of inquiry might be to see if I can get PERL to break-point when this "uninitialized value" message occurs ...
... at least then I could inspect the value of $dumper at the point of failure.

Any thoughts on how I might track down this intermittent error would be greatly appreciated.
Thank you.

In reply to Help requested to find the cause of an "uninitialized value" message by andyok

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.