We don't bite newbies here... much | |
PerlMonks |
Re^2: do separate hashes share common keys?by LanX (Saint) |
on Feb 14, 2021 at 13:05 UTC ( [id://11128359]=note: print w/replies, xml ) | Need Help?? |
thanks, but I'm confused about the "for example hash keys were already copy-on-write" comment. By principle hash-keys are (and must be) immutable. Immutable data can be shared w/o allocating new memory, while mutable objects need to be copied to separate space. COW is a performance trick to "lazily" delay that copy to the time when the mutation (the write) happens. So there must be a misunderstanding, since hash-keys are always read-only, there is never a write.
Cheers Rolf
In Section
Seekers of Perl Wisdom
|
|