I wish to assign a hash (returned by a method) into another hash, for a given key.
For e.g., a method returns a hash of this form:
hash1->{'a'} = 'a1';
hash1->{'b'} = 'b1';
Now, I wish to assign these hash values into another hash inside the calling method, to get something like:
hash2->{'1'}->{'a'} = 'a1';
hash2->{'1'}->{'b'} = 'b1';
Being new to perl, I’m not sure the best way to do this. But sounds trivial…
Your sub might be:
One key point is that your notation for accessing the variables with the
->arrow operator is dealing with hash refs, not with plain hashes.