Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: memory use when merging tied hashrefs

by LanX (Saint)
on Nov 13, 2019 at 13:40 UTC ( [id://11108630]=note: print w/replies, xml ) Need Help??


in reply to memory use when merging tied hashrefs

I'm not sure I understand your question ...

Let's decompose in simpler steps.

This

 %H3 = (%H1,%H2)

is a list copy, %H1 and %H2 are temporarily flattened to a list of (key,value) pairs, joined and used to constuct a new hash.

 %H3 = ( k1a => v1a, ... , k2a => v2a ,... )

The $hash3 = { ... } part is only taking a ref of the constructed hash list.

Not knowing the nature of your tie, this is the best I can tell.

You might want to check if flattening creates the special costs observed via tied operations.

try print %$hash2

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-26 08:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found