arivu198314 has asked for the wisdom of the Perl Monks concerning the following question:
I need to merge two hashes
@val=({23=>1, 43=>1, 34=>1, 66=>1, 99=>1},{33=>1, 64=>1, 35=>1, 54=>1, + 78=>1});
here we have 1 array within two hashes, now i want merge the two hashes and store as 2nd value of array
means
@val=({23=>1, 43=>1, 34=>1, 66=>1, 99=>1},{33=>1, 64=>1, 35=>1, 54=>1, 78=>1}, {23=>1, 43=>1, 34=>1, 66=>1, 99=>, 33=>1, 64=>1, 35=>1, 54=>1, 78=>1});I have tried below code
$val[2]={$val[0], $val[1]};
It shows compilar error, so please guide me on this
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Merging hash
by BrowserUk (Patriarch) on Oct 04, 2011 at 11:08 UTC | |
by arivu198314 (Sexton) on Oct 04, 2011 at 11:19 UTC |