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

Re^3: Merge Hashrefs

by LanX (Saint)
on Oct 15, 2014 at 15:40 UTC ( [id://1103921]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Merge Hashrefs
in thread Merge Hashrefs

> But this goes only one level deep.

Of course!

Since there are many possible interpretations of what a "deep merge" should do, you should script it in a recursive way after your well defined needs.¹

Cheers Rolf

(addicted to the Perl Programming Language and ☆☆☆☆ :)

update

see also how to merge hash deeply ?

¹) for example what do you expect to happen if both hashes have the same scalar entry?

%a = (x=>1}; %b = (x=>2);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2024-03-28 21:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found