Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Combining / Merging two Ho(H|A)s

by Corion (Pope)
on Feb 21, 2006 at 21:02 UTC ( #531799=note: print w/ replies, xml ) Need Help??


in reply to Combining / Merging two Ho(H|A)s

If you just want the data to be overwritten, it's easy and no loop is needed when you use a hash slice:

@hash1{ keys %hash2 } = values %hash2;

Oh - now I see that you wanted this done recursively. Then you'll need something like GrandFather wrote


Comment on Re: Combining / Merging two Ho(H|A)s
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2015-08-01 03:02 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 (285 votes), past polls