You are saying listify the hash first ala
print Dumper(%hash);
When you should be saying dump the hash as a reference
print Dumper(\%hash);
But as someone said, if you want to dump several top level vars and get them back in a list form
$dump= Data::Dumper->Dump([[\%hash,\@array,$scalar]],[qw(*vars)]); my @vars=eval $dump;
theres a few other tricks as well. You can parse out the var names from dumper then wrap them all in a do and return them as a list, yada yada.

A last point. You may want to dump in Pruity=1 mode.

$Data::Dumper::Purity=1; print Data::Dumper->new([\%foo],['*foo'])->Purity(1)->Dump;
Be aware that seriously sick and twisted data structures dont dump properly with Data::Dumper. For this reason unless hand modification is needed of the dumped data you should use Storable instead. Also, evaling these structres from a file is a serious security risk (hostile code can be embedded in the file and will execute with your permissions when you eval it). Another good reason to use Storable (which has an easy to use reader too.)

Anyway,

--- demerphq
my friends call me, usually because I'm late....


In reply to Re: Re: Re: Re: Re: Module to read a dumped file by demerphq
in thread Module to read a dumped file by juo

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.