in reply to how can i replace a hash key with other hash value?
%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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |