Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: how to merge hash deeply ?

by LanX (Saint)
on Jan 29, 2013 at 22:38 UTC ( [id://1015937]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      DB<131> $conf3 = { db => { %{$conf1->{db}}, %{$conf2->{db}} } } 
    => 
    ...
            },
    }
    
  2. or download this
      DB<132> $conf3 = { map { $_ => { %{$conf1->{$_}}, %{$conf2->{$_}} } 
    +} keys %{{ %$conf1,  %$conf2 }} }
     => 
    ...
              user     => "pdte_usr",
            },
    }
    
  3. or download this
      DB<142> sub merge_hr {  return  { %{$_[0]}, %{$_[1]} } } 
    
    ...
              user     => "pdte_usr",
            },
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2024-04-19 08:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found