Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Read the Dumper data back to a hash.

by moritz (Cardinal)
on Jun 21, 2010 at 06:38 UTC ( #845673=note: print w/ replies, xml ) Need Help??


in reply to Read the Dumper data back to a hash.

Don't dump the hash as

print Dumper %hash;

But rather use

print Dumper \%hash; # ^

Then you can simply use eval to obtain a hash reference, so for example

my %copied_hash = %{ eval $string };
Perl 6 - links to (nearly) everything that is Perl 6.


Comment on Re: Read the Dumper data back to a hash.
Select or Download Code
Replies are listed 'Best First'.
Re^2: Read the Dumper data back to a hash.
by rachitmohta11 (Novice) on Jun 21, 2010 at 07:07 UTC
    What is $string in eval $string? Is it the file handle?

      The string returned by Dumper.

        Sorry, but i could not understand.
        Please tell me how does Dumper return the string..

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://845673]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (16)
As of 2015-07-07 21:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls