Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by Hofmator (Curate)
on Dec 20, 2006 at 11:57 UTC ( [id://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.

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://590893]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2024-04-19 04:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found