Beefy Boxes and Bandwidth Generously Provided by pair Networks
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??


in reply to Re: do separate hashes share common keys?
in thread do separate hashes share common keys?

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
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11128359]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-03-28 08:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found