Terse shouldnt be used in anything other than a diagnostic context. Useqq reduces the performance of your code (with certain Win32 related caveats). You dont have Purity set. The way you are dumping is at face value incorrect, and even if its deliberate is extremely prone to greivous error.

Better to do something like:

print DATAFILE Data::Dumper->new([\%some_hash],[qw(some_hash)]) ->Purity(1) ->Terse(0) ->Indent(1) ->Useqq(0) ->Dump();

And then eval it into existance. Although in some conditions this is a security concern, in which case I suggest you use YAML.

Essentially your problem is that you are trying to use a hammer to do a firehoses job. Dumper is for dumping data structures in perl code. YAML is about dumping data structures in human readable, language independent, and eval safe ways. The two purposes are very different indeed.


---
demerphq

<Elian> And I do take a kind of perverse pleasure in having an OO assembly language...

In reply to Re: uninitialized value loading into hash and printing by demerphq
in thread uninitialized value loading into hash and printing by Anonymous Monk

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.