Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Re: Function to measure size of a hash

by simeon2000 (Monk)
on Jul 24, 2002 at 15:35 UTC ( [id://184894]=note: print w/replies, xml ) Need Help??


in reply to Re: Function to measure size of a hash
in thread Function to measure size of a hash

Good solution... however, what if it's a multi-dimensional hash? Perhaps a recursive function that'll traverse the tree and find the number of bytes in each branch and eventually return it to the top?

However, I believer perl requires quite a few bytes extra for storing each scalar, as well as even more bytes to keep track of hash mappings, so if the purpose of this proposed chunk of code is to help work out memory constraint on a system, the value it returns will be optimistically low at best.

"Falling in love with map, one block at a time." - simeon2000

  • Comment on Re: Re: Function to measure size of a hash

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-20 13:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found