Need guidance copying hash key/values from/to different destinations

Hi everyone. I’m not even sure how to word this inquiry properly, so please bear with me. I need a copy routine that will copy key/value pairs to/from:

hash to object
object to object
object to hash
hash to hash

However, I just want the key values (names) and the associated values to copy. I do NOT want to make the destination point to the source in any way. They need to be entire separate entities.

So, if I have as a source:

$puppy
—paws->4
—tail->1
—eyes->2

And I have a blank:

$kitty

I want to end up with the same hash/field names and values as are in $puppy. But I don’t want the destination to point to $puppy in any way. Does that make sense?

Again, the to/from types could be as specified above in bold. Any assistance would be most appreciated. And for those who choose to simply paste a link, I’m having ongoing difficulty with the pages associated with them. They often provide little in the way of examples or in-depth explanations.

TIA

Hey @dolson,

Stack Overflow’s a much better forum for questions about using Perl. Either one of these threads should get you pointed in the right direction:

Cheers!
–zak