Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: How to create a compact data structure?

by Hofmator (Curate)
on Dec 20, 2006 at 11:57 UTC ( #590893=note: print w/ replies, xml ) Need Help??


in reply to Re^2: How to create a compact data structure?
in thread How to create a compact data structure?

I don't know about 'reliable' but 'how' should work like this:

use Devel::Size qw(total_size); # code by perrin my $size_rec_hash = total_size(\%record); my $size_flag_hash = total_size(\%flag); print "Total size: $size_rec_hash + $size_flag_hash =", $size_rec_hash + $size_flag_hash, "\n";
Update: I missed the point, please ignore.

-- Hofmator

Code written by Hofmator and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.


Comment on Re^3: How to create a compact data structure?
Download Code
Re^4: How to create a compact data structure?
by bart (Canon) on Dec 20, 2006 at 12:02 UTC
    You are totally ignoring the fact that these hashes have many keys in common, as every single key in %flag is also a key in %record. And that was precisely the point I was asking about.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2014-09-19 07:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (132 votes), past polls