Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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

by xorl (Deacon)
on Feb 21, 2006 at 20:59 UTC ( #531796=note: print w/ replies, xml ) Need Help??


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

There's nothing like the brute force method

foreach my $key2 (keys %hash2) { $hash1{$key2} = $hash2{$key2}; }
Code untested and probably not has elegant as it could be.


Comment on Re: Combining / Merging two Ho(H|A)s
Download Code
Replies are listed 'Best First'.
Re^2: Combining / Merging two Ho(H|A)s
by jkva (Chaplain) on Feb 21, 2006 at 21:02 UTC
    Brute it is. Perhaps I didn't specify that well enough - in this case the nested hashes overwrite eachother instead of merging. This is not what I intend.
    Thanks for your reply, though.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (14)
As of 2015-07-07 17:36 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