http://www.perlmonks.org?node_id=1045269


in reply to How can I populate attributes of a hash into another ?

No way. If you add a reference to the %book hash,  print $chapter{name} will still not print what you want. Why do you want to add a book under chapter anyway? Are you sure your data model is good?


I'm too lazy to be proud of being impatient.

Replies are listed 'Best First'.
Re^2: How can I populate attributes of a hash into another ?
by Monk::Thomas (Friar) on Jul 19, 2013 at 08:15 UTC
    Maybe there is a way. You could create a tied hash which looks up key/values somewhere else if they are not present.

    However that's something I definitely do not recommend at all. This way lies loss of sanity and lots of hairpulling.

Re^2: How can I populate attributes of a hash into another ?
by ravi06 (Novice) on Jul 19, 2013 at 07:06 UTC
    Yes. I am sure about the data model.