chinaxing has asked for the wisdom of the Perl Monks concerning the following question:
I have two configure file defined by perl hash:
#file1: read as $conf_file1 { db => { name => 'pdte', host => 'localhost', } } #file2: read as $conf_file2 { db => { port => '5432', user => 'pdte_usr', password => 'pdte_213456', } } my $new_conf = { %$conf_file1, %conf_file2 }
but this type of merge can only merge hash level1, cannot merge higher than level1.
How can i complete this merge in perl ?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: how to merge hash deeply ?
by Kenosis (Priest) on Jan 29, 2013 at 04:49 UTC | |
by chinaxing (Acolyte) on Jan 31, 2013 at 07:11 UTC | |
by Kenosis (Priest) on Jan 31, 2013 at 08:08 UTC | |
Re: how to merge hash deeply ?
by Athanasius (Archbishop) on Jan 29, 2013 at 04:10 UTC | |
Re: how to merge hash deeply ?
by LanX (Saint) on Jan 29, 2013 at 22:38 UTC |
Back to
Seekers of Perl Wisdom