%hash = { 'chapter' => { 'subchap1' => { 'p' => 'sathish is a good bou', 'content' => 'sathish is good boy + or not ' }, 'content' => 'sathish ' } }; %hash1 = { 'chapter' => { 'subchap1' => { 'p' => 'para', 'content' => 'body ' }, 'content' => 'head ' } }; i want the output as shown below %hash= { 'head'=> { 'body' => { 'para' => 'sathish is a good bou' +, 'content' => 'sathish is good boy + or not ' }, 'content' => 'sathish ' } };
I'm afraid I don't understand your replace logic. If p is supposed to be replaced with para (which I presume is because of 'p' => 'para' in hash1), why isn't content meant to be replaced with body, but rather subchap1 with body?
In reply to Re: how can i replace a hash key with other hash value?
by almut
in thread how can i replace a hash key with other hash value?
by satzbu
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |