Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Copy of multidimensional hash

by johngg (Abbot)
on Jan 03, 2013 at 09:02 UTC ( #1011422=note: print w/ replies, xml ) Need Help??


in reply to Copy of multidimensional hash

I believe it is because your %two hash contains as values references to the same anonymous arrays as are in %one. You would have to do something like (not tested)

my %two; foreach my $key ( keys %one ) { $two{ $key } = [ @{ $one{ $key } } ]; }

in order to create values which are new anonymous arrays containing the same contents as those in the original hash.

I hope this is helpful.

Cheers,

JohnGG


Comment on Re: Copy of multidimensional hash
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (7)
As of 2014-08-20 22:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (124 votes), past polls